wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Slowdown/lag after using SwitchToWorkspace with SSH connection

Open madsholme opened this issue 1 month ago • 4 comments

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

GNOME Shell 49.1 (Wayland) / Mutter 49.1

WezTerm version

20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Fedora 43, gnome, all the latest updates, wayland...

I have a ssh favorites menu, that uses workspace to spawn a ssh session in. When i do that and exit the ssh session, the workspace is removed, but wezterm gets really slow that it only updates if i touch a key on the keyboard. if i

if i use open_mode = "new_tab" instead of workspace there is no problems.

This has not always been a problem, it started to apear in one of the nightly builds but im unsure of when. The flatpack does not seem to have this problem.

To Reproduce

use

window:perform_action( act.SwitchToWorkspace { name = hostname, spawn = { args = {"ssh", "user@host"} } }, pane )

to spawn a ssh session to a workspace, then exit it, and top htop. you will see it does not display before you touch a key, input should also start to feel slow

Configuration

`-- Configuration in ssh_favorites.lua local open_mode = "workspace" -- Causes slowdown issue

-- SSH connection spawn code window:perform_action( act.SwitchToWorkspace { name = hostname, spawn = { args = {"/bin/zsh", "-c", "export SSH_AUTH_SOCK=" .. ssh_auth_sock .. "; exec ssh " .. username .. "@" .. hostname} } }, pane )

-- WezTerm config settings config.max_fps = 120 config.animation_fps = 60 config.status_update_interval = 3000

-- Minimal update-status handler (no blocking pane queries) wezterm.on("update-status", function(window, pane) local stat = window:active_workspace() local stat_color = "#f7768e"

if window:active_key_table() then stat = window:active_key_table() stat_color = "#7dcfff" end if window:leader_is_active() then stat = "LDR" stat_color = "#bb9af7" end

local time = wezterm.strftime("%H:%M") window:set_left_status(wezterm.format({ { Foreground = { Color = stat_color } }, { Text = " " }, { Text = wezterm.nerdfonts.oct_table .. " " .. stat }, { Text = " |" }, })) window:set_right_status(wezterm.format({ { Text = wezterm.nerdfonts.md_clock .. " " .. time }, { Text = " " }, })) end)

-- WORKAROUND: Changing to this resolves the issue -- act.SpawnCommandInNewTab { args = wrapped_command }`

Expected Behavior

when i exit the ssh in the workspace, wezterm continues to be responsive and not slow down

Logs

No response

Anything else?

No response

madsholme avatar Nov 13 '25 07:11 madsholme

same happening to me using sessionizer and sessionizer-history plugins and switching workspaces.

Some time wezterm stays normal with 3 sessions opened, some times it's getting slow after opening second session.

Wezterm was installed from dnf copr wezfurlong/wezterm-nightly

$ wezterm --version
wezterm 20251111_071056_118802c2
OS: Fedora Linux 42 (Workstation Edition) x86_64
Host: Zenbook UM3402YAR_UM3402YA (1.0)
Kernel: Linux 6.17.7-200.fc42.x86_64
Shell: zsh 5.9
Display (VG279QM): 1920x1080 @ 240 Hz in 27" [External]
Display (NCP0061): 2560x1600 @ 60 Hz (as 1280x800) in 14"]
WM: Hyprland 0.51.1 (Wayland)
Terminal: WezTerm 20251111_071056_118802c2
Terminal Font: Hack Nerd Font Mono
CPU: AMD Ryzen 7 7730U (16) @ 4.55 GHz
GPU: AMD Barcelo [Integrated]

thearturca avatar Nov 20 '25 12:11 thearturca

Interesting. Im using an old sessionizer before it was a plugin, but when it was a script you had to include, as i liked that better. and never used the sessionizer-history plugin.

I just never saw any slowsdowns with sessionizer when using it to switch between my coding workspaces, only when doing ssh open workspace. If i set open ssh to a new tab rater than workspace, there are no slowdowns. ANd if i use the build in flatpack there is no issue.. so its something that happened in a nightly build somewhere along the line.

madsholme avatar Nov 20 '25 13:11 madsholme

Under the hood sessionizer plugin uses SwitchToWorkspace.

Btw switching config.front_end to"WebGpu" and disabling wayland doesn't solve the problem.

thearturca avatar Nov 20 '25 13:11 thearturca

I think this is related to this issue I reported a year ago https://github.com/wezterm/wezterm/issues/6330. I'm seeing the same issues and I was able to reproduce it by exiting the shell in the last pane of a workspace. It will stop triggering update-status and the shell will freeze until the next key press as described here

caenrique avatar Nov 28 '25 12:11 caenrique

i find it weird this does not get more response, wezterm is almost unsuable for me now. i use workspaces for everything, and wezterm gets really slow, it was not a problem a half year ago.

madsholme avatar Dec 15 '25 09:12 madsholme