wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.68k stars 745 forks source link

Pane focus changing constantly despite no input #4484

Open VRichardJP opened 10 months ago

VRichardJP commented 10 months ago

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

Linux X11

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

X11, Mutter

WezTerm version

20230712-072601-f4abf8fd

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

No, and I'll explain why below

Describe the bug

In the example below, I have 2 tabs, and the 2nd tab contains 3 panes. Although I am not pressing any key or moving the mouse around, the focus keeps jumping from pane to pane. Clicking on the 1st tab has no effect (wezterm immediately goes back to the 2nd tab). Clicking on any pane, or clicking on another window does not change anything either:

wezterm_focus_jump-2023-10-24_13.02.58.webm

The problem continues even when wezterm does not have the focus, so it is not like if one of my keyboard key was stuck or something. The only way I have found to stop this behavior is to forcefully stop and close (CTRL-C, CTRL-D) each pane until it eventually stops.

To Reproduce

This bug is quite seldom: over the last week of work, it occured like 2~3 times. I have not identified any specific pattern: I just have some tabs and panes, and at some point it starts to act crazily.

I have been using wezterm for maybe a month, but this behavior has appeared fairly recently.

Configuration

local wezterm = require 'wezterm'

local config = {}

if wezterm.config_builder then
  config = wezterm.config_builder()
end

local scheme = wezterm.color.get_builtin_schemes()['Gruvbox Dark (Gogh)']
scheme.scrollbar_thumb = "#e6d4a3"
config.color_schemes = {
        ['Gruvbox Custom'] = scheme,
}

-- config.color_scheme = 'Gruvbox Dark (Gogh)'
config.color_scheme = 'Gruvbox Custom'
config.enable_scroll_bar = true
config.hide_tab_bar_if_only_one_tab = true
config.pane_focus_follows_mouse = true
config.scrollback_lines = 100000
config.font_size = 10.0

return config

Expected Behavior

Focus should not jump around without reason.

Logs

(I will try to catch it next time)

Anything else?

No response

zapman449 commented 1 month ago

I see the same thing infrequently on MacOS. I've seen this twice now?

Notably, I have pane_focus_follows_mouse = true, in my config.

The second time I saw this, moving the mouse into a pane would briefly give focus to the pane, but if I hit any key (including the ctrl key) the focus would immediately jump to a random different pane within the same window/tab.

This time I was able to recover by closing the tab-of-panes and the system recovered... I was able to gracefully close the other windows/panes etc.

FWIW, my full config can be found here: https://github.com/zapman449/dotfiles/blob/master/wezterm/.wezterm.lua