Wezterm is haunted
What Operating System(s) are you seeing this problem on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
KDE Plasma 6.3.5
WezTerm version
wezterm 20240203-110809-5046fc22
(also happened once in wezterm 20250524-112104-b11cd7ae AFAIK)
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
When I start Wezterm, everything is fine. I'm happy. After a day or two, the terminal start behaving strangely. First the selection (with left click) changed from 'Cell' to 'Line' with no reason.
It still lists as:
$ wezterm show-keys
[...]
Mouse
-----
Down { streak: 1, button: Left } -> SelectTextAtMouseCursor(Cell)
SHIFT Down { streak: 1, button: Left } -> ExtendSelectionToMouseCursor(Cell)
ALT Down { streak: 1, button: Left } -> SelectTextAtMouseCursor(Block)
SHIFT | ALT Down { streak: 1, button: Left } -> ExtendSelectionToMouseCursor(Block)
Down { streak: 1, button: Middle } -> PasteFrom(PrimarySelection)
Down { streak: 1, button: WheelUp(1) } -> ScrollByCurrentEventWheelDelta
Down { streak: 1, button: WheelDown(1) } -> ScrollByCurrentEventWheelDelta
Down { streak: 2, button: Left } -> SelectTextAtMouseCursor(Word)
Down { streak: 3, button: Left } -> SelectTextAtMouseCursor(Line)
Drag { streak: 1, button: Left } -> ExtendSelectionToMouseCursor(Cell)
ALT Drag { streak: 1, button: Left } -> ExtendSelectionToMouseCursor(Block)
SHIFT | CTRL Drag { streak: 1, button: Left } -> StartWindowDrag
SUPER Drag { streak: 1, button: Left } -> StartWindowDrag
Drag { streak: 2, button: Left } -> ExtendSelectionToMouseCursor(Word)
Drag { streak: 3, button: Left } -> ExtendSelectionToMouseCursor(Line)
Up { streak: 1, button: Left } -> CompleteSelectionOrOpenLinkAtMouseCursor(ClipboardAndPrimarySelection)
SHIFT Up { streak: 1, button: Left } -> CompleteSelectionOrOpenLinkAtMouseCursor(ClipboardAndPrimarySelection)
ALT Up { streak: 1, button: Left } -> CompleteSelection(ClipboardAndPrimarySelection)
SHIFT | ALT Up { streak: 1, button: Left } -> CompleteSelectionOrOpenLinkAtMouseCursor(PrimarySelection)
Up { streak: 2, button: Left } -> CompleteSelection(ClipboardAndPrimarySelection)
Up { streak: 3, button: Left } -> CompleteSelection(ClipboardAndPrimarySelection)
when it happens, but it's clearly selecting the whole line instead of the cell I clicked on. If I close Wezterm, and reopen, it works again perfectly until... some times.
Also, if I click on the new tab button, 4 tabs are opened at one, see video attached:
https://github.com/user-attachments/assets/2bc8de14-46be-4689-bceb-df4d585806cc
To Reproduce
I don't know when it start getting corrupted, so I can't give a step by step guide here.
Also, no reset or clear command seems to fix it.
Configuration
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
config.font = wezterm.font 'Menlo'
config.font_size = 9.5
--config.color_scheme = 'Floraverse'
config.color_scheme = 'Obsidian'
--config.color_scheme = 'SoftServer'
--config.color_scheme = 'Tomorrow Night Bright'
config.window_background_image = '/home/user/Images/term_bg.png'
local mux = wezterm.mux
wezterm.on('gui-startup', function(cmd)
local tab, pane, window = mux.spawn_window(cmd or {})
window:gui_window():maximize()
end)
-- No mouse assigment, don't know why it fails
--config.disable_default_mouse_bindings = true
-- and finally, return the configuration to wezterm
return config
Expected Behavior
Wezterm shouldn't behave like it does, it shouldn't change its working mode without explicit user request.
It should revert to the default configuration when typing reset
Logs
Debug Overlay
wezterm version: 20240203-110809-5046fc22 x86_64-unknown-linux-gnu
Window Environment: Wayland
Lua Version: Lua 5.4
OpenGL: Mesa Intel(R) UHD Graphics (CML GT2) 4.6 (Compatibility Profile) Mesa 25.0.5-arch1.1
Enter lua statements or expressions and hit Enter.
Press ESC or CTRL-D to exit
12:45:43.750 INFO wezterm_gui::termwindow > clicking http://repo.huaweicloud.com/debian
15:17:36.658 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.659 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.660 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.662 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.664 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.666 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
15:17:36.668 ERROR window::os::wayland::pointer > set_cursor: Unable to set cursor to hand: cursor not found
16:31:33.846 ERROR wezterm_mux_server_impl::local > writing pdu data buffer: Broken pipe (os error 32)
Anything else?
No response
Might be the same as #6435
I'll try when it happens again, thanks. This doesn't explain the 4 tabs invocation upon a single click though.
I ran into this as well. I'm using the default configuration (no wezterm.lua) on Plasma Wayland too.
I'm half me-too on this. I cannot get wezterm to reliably switch to wezterm.action.SelectTextAtMouseCursor 'Cell',. I have
config.mouse_bindings = {
{
event = { Down = { streak = 1, button = 'Left' } },
action = wezterm.action.SelectTextAtMouseCursor 'Cell',
mods = 'NONE',
},
}
in .wezterm.lua and can confirm that it is loaded (by fiddling with the font elsewhere in the file).
If I start a new wezterm process with wezterm start --always-new-process the new process windows will do the right thing, but the old process windows never do.