feat: wezTerm session_manager

This commit is contained in:
2025-04-06 18:47:40 +02:00
parent 9a6396a898
commit 13eecb746e
4 changed files with 39 additions and 18 deletions

View File

@ -54,8 +54,12 @@ return {
mods = "LEADER",
action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }),
},
},
-- session manager
{ key = "s", mods = "LEADER", action = act({ EmitEvent = "save_session" }) },
{ key = "l", mods = "LEADER", action = act({ EmitEvent = "load_session" }) },
{ key = "r", mods = "LEADER", action = act({ EmitEvent = "restore_session" }) },
},
key_tables = {
resize_pane = {
{ key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) },

View File

@ -1,5 +1,6 @@
local wezterm = require("wezterm")
local mappings = require("modules.mappings")
local session_manager = require("wezterm-session-manager/session-manager")
-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
@ -10,9 +11,19 @@ wezterm.on("update-right-status", function(window, pane)
window:set_right_status(name or "")
end)
wezterm.on("save_session", function(window)
session_manager.save_state(window)
end)
wezterm.on("load_session", function(window)
session_manager.load_state(window)
end)
wezterm.on("restore_session", function(window)
session_manager.restore_state(window)
end)
return {
default_cursor_style = "BlinkingBlock",
color_scheme = "Poimandres",
color_scheme = "Catppuccin Mocha",
colors = {
cursor_bg = "#A6ACCD",
cursor_border = "#A6ACCD",
@ -26,7 +37,7 @@ return {
-- tab bar
use_fancy_tab_bar = true,
tab_bar_at_bottom = false,
hide_tab_bar_if_only_one_tab = true,
hide_tab_bar_if_only_one_tab = false,
tab_max_width = 999999,
window_padding = {
left = 7,