wezterm
wezterm copied to clipboard
Investigation "Wrapped long line copy under tmux"
What Operating System(s) are you seeing this problem on?
Windows
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
wezterm 20231228-084719-ff274374
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
Hi. First, I really liked to use wezterm on my daily work and I satisfied most of features. One thing I am having a problem is that copying single logical line on multiple physical line on tmux. I also searched issues on the board and I found already closed issues such as https://github.com/wez/wezterm/issues/4706 and https://github.com/wez/wezterm/issues/5016.
I spent some time to debug why this is happening on tmux and I found the reason should_mark_wrapped is set to false when alt screen is on. https://github.com/wez/wezterm/blob/cce0706b1f2a9e2d1f02c57f2d1cd367c91df1ae/term/src/terminalstate/performer.rs#L165
I confirmed that it worked as expected after removing '!is_alt'
Can we remove this condition ? Or is there any reason for checking is_alt ?
To Reproduce
No response
Configuration
no config
Expected Behavior
logical single line should be copied as single line.
Logs
No response
Anything else?
No response
The main reason is this, and it pertains to re-flowing text on resize:
https://github.com/wez/wezterm/blob/cce0706b1f2a9e2d1f02c57f2d1cd367c91df1ae/term/src/terminalstate/performer.rs#L146-L149
the consequence of changing this is that it would make resizing more expensive for full-screen apps like editors, and there is potential for wezterm to compete with the application when it comes to re-drawing the screen contents, although I'm not sure if that would be as bad as it would be for eg: a shell in non-alt mode.
If you can try a few different tui apps (not just tmux) and try aggressively and quickly resizing them to see if things work ok, then I'd be open to a PR for that small change.
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.