wez / wezterm

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

Wezterm -> MUX -> tmux => garbled text #4041

Open j-xella opened 1 year ago

j-xella commented 1 year ago

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 20230717-111633-94ab0496

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

I run Wezterm on Windows, connecting to Ubuntu 20.4 server. Server connection details are stored in ssh config file. From there, I get into tmux session.

When I connect via ssh (wezterm-gui ssh myhost or wezterm-gui connect SSH:myhost), everything works fine.

When I connect via Wezterm MUX (wezterm-gui connect SSHMUX:myhost), I experience the following issues:

  1. Resizing wezterm window can break the display of the contents
  2. Tmux sessions are not displayed correctly

To Reproduce

To reproduce issue # 1 :

  1. After opening a session, in shell, produce many lines of text, way more than visible lines of the terminal. So that the cursor is comfortably at the bottom of the terminal window.
  2. Start resizing the terminal window. Make it bigger, stop. Make it smaller, stop. Repeat many times.
  3. In theory, the cursor should stay at the bottom of the terminal. But in practice, it may lag behind:
    • after increasing the terminal window, the bottom part of the window will be unused.
    • after decreasing the window, the cursor may be below the terminal window's bottom.

To reproduce issue # 2 :

See attached screencast.

wezterm-recording-ssh-135-63.cast.txt

This is how it looks when replayed in MUX session:

image

Configuration

config.ssh_domains = wezterm.default_ssh_domains()
for _,dom in ipairs(config.ssh_domains) do
  dom.assume_shell = 'Posix'
  dom.remote_wezterm_path = '/path/to/wezterm'
end

config.hide_tab_bar_if_only_one_tab = true

config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"

config.window_frame = {
  border_left_width = 1,
  border_right_width = 1,
  border_bottom_height = 1,
  border_top_height = 1,
  border_left_color = 'silver',
  border_right_color = 'silver',
  border_bottom_color = 'silver',
  border_top_color = 'silver',
}

config.window_padding = {
  left = 3,
  -- right = 3,
  top = 3,
  bottom = 3,
}

config.enable_scroll_bar = true
-- How many lines of scrollback you want to retain per tab
config.scrollback_lines = 10000

Expected Behavior

Connecting via multiplexer works the same way as without it, in terms of displaying the session text.

Logs

No response

Anything else?

No response

brandonchinn178 commented 1 year ago

+1. I'm working around this with set-option -g status-position top

sedlund commented 8 months ago

I think same thing when running btop in a bottom pane, and just pressing enter repeatedly on a zsh powerlevel10k prompt in the top pane. Moving the status bar to the top as mentioned above fixes it - if you can get used to it 🙃

wezterm-mux-tmux-statusline

Windows: wezterm 20230712-072601-f4abf8fd

pandada8 commented 6 months ago

Same on linux using MUX + tmux I can reproduce the garbled text by keep pressing Enter only in the topmost pane. e.g. Pressing Enter in pane 2 don't generate garbled text

+------------+
|     1      |
+------------+
|     2      |
+------------+
|     3      |
+------------+

vertical split seems don't trigger the garbled text too (long pressing Enter in 1,2,3)

+---------+--------+
|         |        |
|      1  |        |
+---------+ 3      |
|      2  |        |
|         |        |
|         |        |
+---------+--------+