Skip to content

Restoring does not work with multiplexer panes #16

@weierophinney

Description

@weierophinney

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions