wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Pane focus changing constantly despite no input

Open VRichardJP opened this issue 2 years ago • 1 comments

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

VRichardJP avatar Oct 24 '23 04:10 VRichardJP

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

zapman449 avatar Aug 13 '24 15:08 zapman449

I have this same issue and run into it quite frequently, i.e. multiple times a day. Until recently I was able to use ctrl+shift+z to zoom in on a pane and that would stop the constant pane switching. But now that doesn't work anymore.

Indeed I also have pane_focus_follows_mouse = true.

JelteF avatar Oct 31 '24 22:10 JelteF

Same issue on macOS with pane_focus_follows_mouse = true, it's seemingly random but seems to occur when I'm switching between apps using Cmd+Tab while also moving the mouse.

pyrho avatar Nov 07 '24 12:11 pyrho

I'm having the same issue too with Ubuntu 22.04 (X11) with setting pane_focus_follows_mouse = true. There is any way that I can help with this issue, since this feature is very useful and facilitate the use of wezterm?

ricardoseriani avatar Nov 13 '24 18:11 ricardoseriani

Also seeing this, and I have pane_focus_follows_mouse = true enabled, too (on MacOS). Closing all panes except for one restores normal behavior, although it's tricky to do with the focus changing multiple times per second.

I really like the pane_focus_follows_mouse = true behavior. Is there anything we can help to debug this, e.g. capture logs etc.?

lgruen-vcgs avatar Jul 04 '25 02:07 lgruen-vcgs