wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

wezterm crash when copy in wayland

Open HIDE-r opened this issue 1 year ago • 2 comments

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

Linux Wayland

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

hyprland

WezTerm version

wezterm 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

crash when use cursor select text, or use copy mode

❯ wezterm --config enable_wayland=false --skip-config start -- bash
01:49:27.850  ERROR  wezterm_gui > running message loop: process_queued_xcb: process_xcb_event_ime: ChangeProperty {
    mode: Replace,
    window: Window {
        res_id: 2097322,
    },
    property: Atom {
        res_id: 246,
    },
    type: Atom {
        res_id: 294,
    },
    data: [
        99,
        111,
        108,
        108,
        105,
        110,
        64,
        76,
        101,
        110,
        111,
        118,
        111,
        45,
        82,
        57,
        48,
        48,
        48,
        75,
    ],
}: X(Window(ValueError { response_type: 0, error_code: 3, sequence: 1032, bad_value: 2097322, minor_opcode: 0, major_opcode: 18, pad: 1 }), Some("x::ChangeProperty")); terminating

To Reproduce

No response

Configuration

no config also happens

Expected Behavior

no crash

Logs

No response

Anything else?

No response

HIDE-r avatar May 27 '24 17:05 HIDE-r

same issues

ystyle avatar Jun 16 '24 08:06 ystyle

I am facing the same issue. Wezterm crashes sometimes upon copying or when entering the QuickSelect mode.

Edit: I am running wezterm 20240203-110809-5046fc22

akshettrj avatar Jun 29 '24 10:06 akshettrj

Just to add, this is likely to affect at least all Arch users as I think the incompatibility was introduced with a recent-ish hyprland update.

The crash also kills all open wezterm terminals which is quite disruptive.

Has anyone found a workaround yet?

GertBurger avatar Jul 02 '24 09:07 GertBurger

Just to add, this is likely to affect at least all Arch users as I think the incompatibility was introduced with a recent-ish hyprland update.

The crash also kills all open wezterm terminals which is quite disruptive.

Has anyone found a workaround yet?

NixOS-unstable is also affected

akshettrj avatar Jul 02 '24 09:07 akshettrj

As a workaround I have disabled the default mouse bindings using config.disable_default_mouse_bindings = true

but I guess one can also try to disable the problematic bindings individually:

config.mouse_bindings = {
    {
        event = { Down = { streak = 1, button = 'Left' } },
        action = wezterm.action.DisableDefaultAssignment
    },
    {
        event = { Down = { streak = 2, button = 'Left' } },
        action = wezterm.action.DisableDefaultAssignment
    },
    {
        event = { Down = { streak = 3, button = 'Left' } },
        action = wezterm.action.DisableDefaultAssignment
    },
    {
        event = { Down = { streak = 4, button = 'Left' } },
        action = wezterm.action.DisableDefaultAssignment
    },
    {
        event = { Drag = { streak = 1, button = 'Left' } },
        action = wezterm.action.DisableDefaultAssignment
    },
    {
        event = { Drag = { streak = 1, button = 'Left' } },
        mods = "ALT",
        action = wezterm.action.DisableDefaultAssignment
    },
}

this list is not complete.

Note that doing a selection in copy mode doesn't trigger the crash but copying the selection (y) does.

GertBurger avatar Jul 02 '24 09:07 GertBurger

I have a different workaround atm. Latest git (20240722-080956-7e8fdc11) build works with wayland support enabled and therefore doesn't trigger this issue.

The arch package wezterm-git is slightly broken so you can't just install it directly, see https://aur.archlinux.org/packages/wezterm-git#comment-974618

I ended up copying the PKGBUILD file from that link to a dir, removing the w terminfo installation lines. Running makepkg and the installing the generated package using pacman -U thepackage.tgz

GertBurger avatar Jul 23 '24 11:07 GertBurger

The same issue & error code appears in Hyprland 0.42 on NVIDIA GPUs if render:explicit_sync is set to true which is the default setting on select NVIDIA cards.

As a workaround, set render:explicit_sync = false in your hyprland.conf, or do what @GertBurger mentioned and disable mouse copy bindings.

shovel-kun avatar Aug 14 '24 11:08 shovel-kun

This should be resolved now in main.

It typically takes about an hour before commits are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

wez avatar Sep 14 '24 16:09 wez

Should have benn resolvd in main. The bug is disappeared. Close.

HIDE-r avatar Sep 15 '24 00:09 HIDE-r

Thanks Wez!

GertBurger avatar Sep 15 '24 08:09 GertBurger

You should thank @loops for identifying and resolving this!

wez avatar Sep 15 '24 12:09 wez

Thanks @loops! :P

@wez tbf, you did most of the work in this project so it is still well deserved

GertBurger avatar Sep 16 '24 14:09 GertBurger

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Oct 17 '24 03:10 github-actions[bot]