wez / wezterm

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

Copy mode deselects when copying in tmux #6163

Open Grazfather opened 1 month ago

Grazfather commented 1 month ago

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

macOS

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

No response

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?

No, and I'll explain why below

Describe the bug

Can't use lately on work computer.

When I ssh to a machine and use tmux on that machine, copy mode does not work well. It very quickly deselects the text, making it frustrating to use.

To Reproduce

ssh to a host, open tmux, enter copy mode.

https://github.com/user-attachments/assets/fcc72bff-d444-45ba-8b8f-a1c004c937d1

Configuration

no config

Expected Behavior

selecting stays

Logs

No response

Anything else?

No response

loops commented 1 month ago

Hi Grazfather,

Just as a data point, i'm unable to reproduce this issue here on Linux, even using the same version of Wezterm as you. I did:

$ wezterm -n

and then

$ ssh remote.host $ tmux

And then entered copy mode, and selected text without any problem.

Does the error still occur if you start up Wezterm without reading your config file (ie. starting with "wezterm -n")? And what about if you try again with the nightly version?

Grazfather commented 1 month ago

Yes I can reproduce with wezterm -n.

This is actually not with ssh directly, it's with some work application that does some tunneling to ssh to a vps. I've confirmed that I can't reproduce it on my personal machine when using ssh + tmux, and I confirmed that I can't reproduce if I use the work tunnel ssh without tmux.

I can try to try the nightly, but work policies may not allow installing it.

wez commented 1 month ago

That sort of behavior happens when the screen is being invalidated/repainted. Even if it looks the same after the update, we consider updates to have invalidated it and cancel the selection in that region.

It sounds like maybe the tunnel infrastructure might be some kind of active thing that is interfering with the screen updates?

Grazfather commented 1 month ago

Ah that makes sense. Is there an easy way that I could verify, by somehow logging these updates? It's a bit strange that I only get it with the combo of ssh + the tunnel. If I can see these updates come in and see they are correlated with my selection getting nuked, that would basically confirm.

That said, now that I know this is because of some weird work-related thing, I can just live with it, and you can feel free to close this.

Thanks!

ZhilinS commented 6 days ago

Hey, I just encountered the same issue while using tmux on my local machine (also MacOS, but not over ssh or something). Everything works perfectly outside of tmux.

I also wanted to mention that scrolling in tmux doesn't work in this mode, but it functions fine outside of tmux.

I'm using version: wezterm 20240203-110809-5046fc22.

P.S. I stopped using tmux and configured pane and tab management with my tmux keymap, so I hope this message just sheds some light on the behavior