I've been attempting to use this with the mux server, and discovered that while I can save a workspace that's running inside the mux server, I cannot restore from one.
To debug, I spawned my terminal from a gnome-terminal session so I could view the logs. I came across this immediately:
wezterm_gui::termwindow > while processing restore_session event: runtime error: ...nfig/wezterm/wezterm-session-manager/session-manager.lua:105: attempt to index a nil value (local 'foreground_process')
Lines 102-105 read:
local foreground_process = initial_pane:get_foreground_process_name()
-- Check if the foreground process is a shell
if foreground_process:find("sh") or foreground_process:find("cmd.exe") or foreground_process:find("powershell.exe") or foreground_process:find("pwsh.exe") or foreground_process:find("nu") then
The problem is that in stable versions of wezterm, get_foreground_process_name() only works for local panes; it does not work with multiplexer panes or with SSH panes. In my particular case, I'm in the multiplexer. As such, the function returns nil, which then leads to an exception when trying to call find() on the variable in the conditional.
I'll send a PR shortly.
I've been attempting to use this with the mux server, and discovered that while I can save a workspace that's running inside the mux server, I cannot restore from one.
To debug, I spawned my terminal from a gnome-terminal session so I could view the logs. I came across this immediately:
Lines 102-105 read:
The problem is that in stable versions of wezterm,
get_foreground_process_name()only works for local panes; it does not work with multiplexer panes or with SSH panes. In my particular case, I'm in the multiplexer. As such, the function returnsnil, which then leads to an exception when trying to callfind()on the variable in the conditional.I'll send a PR shortly.