terminal
terminal copied to clipboard
Rendering errors in tmux split panes
Environment
Windows build number: Microsoft Windows [Version 10.0.19042.388]
Windows Terminal version (if applicable): 1.0.1811.0
tmux 3.0a
Alacritty 0.4.2
Steps to reproduce
Run tmux
in Windows terminal WSL2 (Ubuntu), after a fresh boot into Windows.
Create some horizontal split panes in tmux
(works)
Create some vertical split panes in tmux
Run some commands with output (in some panes)
Oddly, the symptom disappears if I close and start Windows terminal again and re-attach to tmux
.
Expected behavior
Text output is clear and readable and output in their respective panes.
Actual behavior
The text output from different processes seems to bleed across panes.
This occurs with a vanilla/empty tmux
config too.
My TERM
is set to xterm-256color
outside tmux and tmux-256color
in tmux.
This behaviour also seems to happen in Alacritty (0.4.2), which in my understanding shares the same backend (ConPTY
?) as Windows Terminal.
I have observed the same.
It worked well with the first official release and then broke in the first official update.
I installed a preview release in which it was working, but also recently broke with an update.
I was about to try and test all the recent releases to see where it does/does not work. I noticed an odd thing. If I launch WSL2 and get a tmux session running in an old working version of the official terminal, and then attach a broken version of the preview terminal to the same tmux session the display will remain correct in both terminals. However if I close both terminals and wsl -t
to terminate the wsl session, and then launch wsl and tmux again with a broken terminal it will not render correctly. That surprised me and hopefully is a helpful clue.
For now I've run out of time to try and track this down.
Oh, I missed the close and start again comment. Maybe that is the factor that has made me think certain versions were fixed/broken and explains the render keeps working with both the preview and release versions.
Observing identical problems with: Windows Terminal Version: 1.1.2021.0 Tmux 3.0a WSL 2 / Ubuntu 20.04 TERM=xterm-256color (outside) TERM=tmux-256color (inside)
First - very sorry that this got lost in the triage queue.
Second - does this only repro in tmux 3.0a? Maybe they're using something new in 3.0 that we don't support quite yet? I'm sitting here on 18.04 with tmux 2.6 and I just can not repro this. Lemme pull a 20.04 and see if I can't get this to happen with an updated tmux.
Huh. I could not get this to repro with a fresh ubuntu 20.04 and tmux 3.0a, UNTIL I tried installing fish
:
I'm not sure if it'll happen again, but I could repro this at least once, so there's something.
EDIT: tmux-256color
is certainly a weird termcap:
Alright other findings here
- Once a Windows Terminal pane is corrupted by this, it will stay corrupted. With the pane that's busted for me, every time I try killing all my tmux sessions and opening a new one in that WT pane, it's got the same visual corruption as OP.
- The corruption seems to be caused by tmux or conpty causing the mouse to go back to the 1st column instead of where the pane separator should be. maybe there's a bug with calculating where the tab stops should be?
- tmux is redrawing the contents of the bottom right pane correctly, but when I force a redraw of the entire window, then tmux will draw the corrupted rows starting from column 0, instead of the separator.
- tmux is redrawing the contents of the bottom right pane correctly, but when I force a redraw of the entire window, then tmux will draw the corrupted rows starting from column 0, instead of the separator.
Alright last update:
This has definitely got something to do with line wrapping. My gut thinks that this is related to #6901/#7028/#7253, but I can't be sure, since I can't get a solid repro right now.
Take a look at this output copied from a broken tmux and a working one. They should both have the same contents in their panes:
Note that the first one has all copied as one single wrapped line.
I've also got the attached tracking of me opening tmux, making a [|] split, and running htop in it: gh-6987-trace.txt
There's nothing terribly out of the ordinary there. I split the pane around L958, and start htop around 2215.
I'm gonna toss this on V2, and link it up with #5800. If anyone's got a way to more consistently repro this from a fresh WT window, that'd be much appreciated. Thanks all!
Ho boy this looks awfully a lot like
Tmux pane content gets garbled after refreshing tmux client #4029
Any updates on this? Having the exact same issue pretty consistently as well. Let me know if I can contribute to the troubleshooting process.
I am having a slightly different problem, where the status bar for tmux should grow "taller" by duplicating itself. It also inserts a line with b-21
or 21
at the bottom. Tmux shortcuts are not working as intended as well.
This is observed both on tmux sessions running in a local WSL instance, or tmux sessions hosted on remote Linux machines. The
.tmux.config
file for both tmux sessions are identical, as I source from the same Dropbox directory.
To note, all these problems go away should I stay with wsltty.
@llinfeng there are so many different variables here. Are you using Windows Terminal or the original windows console? What version of Terminal? What version of Windows?
Short summary: what I was describing can be a combination of WSL2 + Windows Terminal (version 1.5.10411.0). On a different machine, the same problem does not reproduce with a WSL1 distro. On the same machine, switching to Windows Terminal Preview from Microsoft Store should also fix the problem.
Here are more a few more detailed notes: (I was using Pengwin for WSL on all three machines listed below.)
Apologize for not including all the details. Here are the Windows specifications for the desktop machine where I took the screenshot. I was using Windows Terminal version 1.5.10411.0, downloaded directly from Microsoft Store. I am using WSL2 on this machine.
Edition Windows 10 Pro
Version 20H2
Installed on 1/31/2021
OS build 19042.804
Experience Windows Feature Experience Pack 120.2212.551.0
Also, with the same version of Windows Terminal from Microsoft Store, the problem is reproduced on a T480 laptop with Win 10 Pro Version 1909. (Well, Pengwin is installed as WSL2 here.)
However, on another Lenovo T480 laptop with the following specifications, the Windows Terminal from the Store should work without a problem.
Edition Windows 10 Pro
Version 20H2
Installed on 2/12/2021
OS build 19042.804
Experience Windows Feature Experience Pack 120.2212.551.0
Here is a screenshot from the 2nd T480 laptop with Win 10 Pro Version 20H2. It is clean as it should be.
Note, this is Pengwin installed as WSL1.
Looks like the Windows Termianl Preview (version 1.6.10412.0) does not produce the Tmux problem, though. Glad to find another viable alternative emulator.
I now attribute the "new variant " of rendering error to vim-prosession, a Vim-plugin. To be more specific, I was including an E0056
character when I ask vim-prosession
to update the window name when I enter vim
from the command line. The following settings in .vimrc
shall reproduce the problem.
let g:prosession_tmux_title = 1
let g:prosession_tmux_title_format = "V-@@@"
Note, on the 2nd line, there was an E0056
char between V
and -
. Inspecting the string "V-@@@"
here shall reveal E0056
.
For a good number of months, though, the E0056
char has been rendered properly with wsltty. Looks like Windows Terminal (or Preview) cannot handle the E0056
char properly when it is inserted into the status bar for Tmux.
Hi, got the same issue recently. Everything was working great all those months. Terminal: 1.6.10571.0 Tmux: 3.0a
I am running into this issue also. It seems to happen when I start my React applications in a tmux split pane and the start up script would automatically open up the React application in Edge. Switching context back into Windows Terminal and I can see this issue. I can fix it simply by closing the terminal, reopening it and re-attaching the running tmux session.
Windows Terminal Version: 1.6.10571.0 Tmux: 3.0a
I had this same issue on the official Windows Terminal, but it is seemingly fixed in the current Windows Terminal Preview v1.7.572.0.
I had this same issue on the official Windows Terminal, but it is seemingly fixed in the current Windows Terminal Preview v1.7.572.0.
Nope, still a problem for me with that version.
Still having rendering issues using tmux with nvim on Windows Terminal Preview 1.7.572.0 I generally use tmux to split panes A temporary work around for my issue was to use Windows Terminal's built in split panes I remapped most of the command shortcuts to be similar to tmux's with the help of this https://docs.microsoft.com/en-us/windows/terminal/panes
Still having rendering issues using tmux with nvim on Windows Terminal Preview 1.7.572.0 I generally use tmux to split panes A temporary work around for my issue was to use Windows Terminal's built in split panes I remapped most of the command shortcuts to be similar to tmux's with the help of this https://docs.microsoft.com/en-us/windows/terminal/panes
Sorry for the confusion on my comment @simeonoff and @JohnDinhDev. Indeed I am still having issues on 1.7.572.0, just fewer. Using WT's built-in panes doesn't cut it for my workflow since I use vim-slime to send across panes and tmuxinator to quickly reset my environment across many different windows.
I'm having similar issues. Windows 10, WSL2 Windows Terminal 1.8.1032.0 Ubuntu 20.04 (fully updated 2021-05-19) tmux 3.0a
Starting tmux, running commands, clearing the screen (with clear
) works fine until I create a split pane (ctrl+b+%).
At that point running clear
will clear only parts of the screen. The prompt is not or only partially displayed.
After closing the split pane the screen is properly refreshed again.
I'm using default tmux configuration (no ~/.tmux.conf
).
If I ssh into a RHEL8 server first and run tmux (version 2.7) there the same problem occurs.
Note I often notice a similar problem when running vimdiff
but I haven't nailed down the exact steps to reproduce that reliably yet.
I have experience the same issue
the split screen function can only work in horizontal split, not vertical split.
Any solution ? Still have this issue :(
I have found that Windows Terminal Preview
has been working better for me than Windows Terminal
. I've seen one instance where the cursor appears to be slightly before where I'm typing but it's only happened once. You can install it through the Microsoft Store.
Windows Terminal 1.9.1942.0 (Rendering issues) Windows Terminal Preview 1.10.1933.0 (No rendering issues) Windows 10, WSL2 Ubuntu 20.04 tmux 3.0a
FWIW, this would be easier to debug if we had solid repro steps. The repro is flakey (and heck, I couldn't get it to happen again while playing with the Terminal this morning), which is part of the reason this is so hard to fix.
My theory is that it's still related to #6901/#7028/#7253/#10130, and the slew of bugs in #5800. #4029 is also probably the same thing, but the two threads have diverged a decent amount so it's impossible to say for sure.
I think this issue can be closed because I am now working with win terminal flawlessly. :)
big thanks to msft terminal dev team.
This issue is related to missing a redraw method call upon tmux history / size change.. I notice that now the redraw method is called to fix this, so if there is no new issues, I believe it can be closed.
👍
@zadjii-msft I think some of the more common render errors I've noticed when using tmux have gone away with the latest (non-preview) version of terminal, but I definitely seem to still be having non-perfect rendering with tmux which I'm happy to help try and get reproductions for, though I may need some guidance as I don't have a strong understanding on how terminals actually work 😅
I'm also not sure if the problems I'm seeing are actually with Windows Terminal or something else such as maybe I'm using a font that doesn't support a specific character (I should be using the stock settings but have had issues in the past where programs decided to stick with an older font after updating).
A common render error I can re-produce is with running bundle exec rails console
:
The green divider line on the right is broken, which "follows" that section of console output:
While not a major error, often when things are more wild there's usually some spillagee of text as well onto the other side of the pane - my typical layout is having rails s
, docker
, and bin/webpack-dev-server
which all tend to spit out a lot of colorful logs as I work.
Still having issues with split panes
All I did was ctrl-b + %
to split panes, and then type ls, then enter
tmux 3.0a
Windows Terminal Preview
Version: 1.11.2421.0
Like @JohnDinhDev split panes in tmux still cause rendering issues
Windows Terminal Preview
Version: 1.11.2421.0
Ubuntu 20.04
tmux 3.0a
Simply split the panes using ctrl-b + %
and run e.g. ls or less
Running vimdiff
inside tmux often causes problems as well but I can't reproduce that on command.
NOT WORKING Strange, got the issue again but doing those steps resolved my issues :O
- Installed Nerd Font Hack (i don't think it is this resolving the issue) - Go to the setting and set the windows to 180 columns, press save
- Change the theme to solarized dark (i don't think it is this resolving the issue), press save - Go to the setting and set the windows to 120 columns back, press save
No more issue... 👯
I have the intuition that changing the columns size fixed my issue
UPDATE: After 5 days, now I have the issue back again :(