Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.61k stars 575 forks source link

Display corruption in irssi, others running inside tmux in WSL bash #1444

Open harakka opened 6 years ago

harakka commented 6 years ago

Versions

ConEmu build: 180206 x64 and x32 both, fresh download, settings reset to default OS version: Windows 10 Pro x64 ver 1709 build 16299.125 Used shell version: WSL bash with wslbridge/connector as launched by the default ConEmu {Bash::bash} task

Problem description

First of all I hope ConEmu is the right place to report this, but to my amateur observation it seemed like the most likely place to start at least. Apologies if that isn't the case.

When running irssi inside tmux in WSL bash, the output becomes garbled during use. It's a bit difficult to describe exactly, but it's particularly notable when using pageup and pagedown to scroll up and down. Irssi scrolls by half a page at a time, and it looks like the other half either doesn't update or gets blanked depending on which way it's being scrolled. This is completely consistent and reproducible on my end. New lines also seem to get printed in the wrong place or some lines don't update correctly. The scrolling problem was the clearest and most consistent one to repro so it's included here as an animated gif: conemu-tmux2 gif

There's visual weirdness in programs other than irssi too, but irssi seems to be most consistent to reproduce for me. In less, after scrolling the status line of tmux at the bottom becomes blank or disappears or is printed in the wrong place, and less' statusline prints either either correctly on the second to last line, or incorrectly on the blank line where tmux' status line was, or it doesn't show at all. Line lengths in manpages (paged by less) get messed up when scrolling at least on a console noticeably wider than the standard 80 characters.

The image below (not animated) is after scrolling down for a bit in less. Also notice how part of the tmux status line (grey background), which should be at the bottom, is at the end of some completely different line. image Also, the issues with less seem to become more pronounced on a console noticeably wider than 80 characters.

Issuing a tmux redraw with Ctrl+b r seems to always fix the screen for that moment, but then it starts getting corrupted again.

I believe this is not a WSL/Windows console issue, or at least not completely, because the tmux+irssi/less combination seems to work fine when WSL bash is started either from normal Windows command prompt or PowerShell. The issues only happen when using WSL bash in ConEmu+tmux.

Based on tmux FAQ there is a similar-looking problem with irssi in normal Linux usage when using incorrect $TERM inside/and outside tmux, but my $TERM is xterm-256color outside and screen-256color inside tmux, which I understand to be the correct configuration.

Steps to reproduce

  1. Create a new console in ConEmu with the default {Bash::bash} task
  2. sudo apt-get install tmux irssi
  3. tmux
  4. irssi
  5. /set prints out all irssi settings, just to give something to scroll around in. If you're quick, you can see there's something odd going on with printing and scrolling already.
  6. press pageup a few times and then pagedown, note how both corrupt the display in a different way

To try seeing corruption in less, although this doesn't seem to happen as consistently:

  1. sudo apt-get install tmux
  2. less /usr/share/doc/bash/README
  3. scroll to the bottom either with arrows or pagedown, you should see the last lines getting corrupted at least
  4. Try a manpage like man bash (less is the default pager) and scrolling around with arrow keys and pageup and pagedown. You can also try resizing the console to be larger than the default, with a wider console the line width seem to become inconsistent once the corruption starts when scrolling.

Actual results

Display corruption and explained and shown above

Expected results

No display corruption.

Logs

Here's a log of me doing the tmux irssi and less activities as explained in the repro steps, where the corruption is showing on my display. ConEmu-2018-02-09-p4956.log

Maximus5 commented 6 years ago

Does bash task contains conemu-cyg-64? Jyst to be sure.

harakka commented 6 years ago

Yep, tasks and settings were reset to defaults before reproing just to be sure, so the bash task command is set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt

Viknet commented 6 years ago

I have exactly the same problem in ConEmu. Same configuration of tmux+irssi looks completely normal in st (through XMing).

It is strange, but if other terminal emulator connected to the same tmux, ConEmu refreshes display correctly.

veryeasily commented 6 years ago

I'm seeing a similar issue too inside of vim when I use visual line mode, and at certain times within just the command line in tmux. If I disable tmux's status bar, this can sometimes clear things up. I am seeing the same issue in the RealConsole, so that makes me unsure if this if this is actually a tmux bug instead of conemu. Here's a screen shot of mine, with the realconsole enabled. 2018-04-21 17_49_33-untitled - paint

Maximus5 commented 6 years ago

How to reproduce?

Maximus5 commented 6 years ago

Or I need ANSI LogFiles https://conemu.github.io/en/AnsiLogFiles.html

lgrangeia commented 6 years ago

I can confirm this issue. I ran into this the other day and can reproduce.

To reproduce, basically install conemu preview, install wslbridge as documented, and run irssi inside a tmux session.

Maximus5 commented 6 years ago

You don't need to "install" wslbridge. It's included in ConEmu distro and all you need - proper default Task created for you by ConEmu.

lgrangeia commented 6 years ago

I meant configure, not install, sorry.

Maximus5 commented 6 years ago

Issue has been already fixed, just wait for a while, new build is on the way

bbrendon commented 6 years ago

The build it's going to be fixed in is the one after 180506?

SilverBut commented 6 years ago

For version 180626, seems this bug is not completely fixed.

I am using WSL with cygwin/msys connector. The following steps can be used to reproduce it:

  1. SSH to remote machine running zsh with theme bullet-train.
  2. open tmux, The cursor position is incorrect now image
  3. execute ls -R or something like that to fill terminal with text. The cursor position is correct now. image

Here is the attached ANSI log (with some info stripped, via Firefox Send, expire after 20 downloads with password notinfected). Task is started with:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt -t zsh
mvandenbos-clgx commented 5 years ago

I am seeing this issue as well.

correctly displayed notfail incorrectly displayed fail

another example (awscli output) morefail

the issue appears to be related to tmux, because i have been unable to replicate the issue outside of tmux. Im using tmux 2.8, but experienced the issue in tmux 2.7 as well.

@Maximus5 suggested this is already fixed, any idea when we'll be able to test it?

madchap commented 5 years ago

the issue appears to be related to tmux, because i have been unable to replicate the issue outside of tmux. Im using tmux 2.8, but experienced the issue in tmux 2.7 as well.

Same here. Posting my comment here because this is one of the rare thread where what I encounter is 100% the same.

For me, that's running weechat in tmux, under CentOS. I cannot reproduce outside of tmux.

Maximus5 commented 5 years ago

What about build 190217?

madchap commented 5 years ago

@Maximus5 if this was addressed to me -- and forgot to mention -- I am running this out of gnome-terminal on Linux, or iTerm2 on MacOS. Hence, it may be that ConEmu is not to blame at all.

l00sed commented 5 years ago

Not sure if this is the same issue you guys have been having, but my status line pushes up every time I switch to another window then back to WSL: image Super annoying. I need to scroll up and down every time I return to bash to reset the rendered lines to their correct position so that I'm not editing on the wrong line.

Just WSL + tmux

Here it is again after flipping between windows and coming back: image

Maximus5 commented 5 years ago

@L00SED No status bar. What version are you running?

l00sed commented 5 years ago

tmux -V returned: tmux 2.6

WSL / Windows build: image

tanmaywadhwa commented 5 years ago

+1. I am seeing this too.

egrubbs commented 4 years ago

I was able to get errors with tmux and vim with the following steps:

  1. tmux
  2. vim (Don't need any data in the file)
  3. :vsp (Split the vim window)
  4. CTRL-W CTRL-R (rotate the split screen)
  5. CTRL-W CTRL-R (sometimes it needs to be done twice before the error appears)

image

Software Versions:

Windows 7 64-bit

Red Hat Enterprise Linux Server release 7.7 (Maipo)

erfantkerfan commented 4 years ago

+1

blacktek commented 3 years ago

Hello, I've the same issue using the "less" command on CentOS 7 servers.

I've Win7 pro 64bit with OpenSSH_8.4p1, OpenSSL 1.1.1f 31 Mar 2020

ConEmu 210912

With vi/vim no problem, but less 99% of the times break the output/console as for the person that opened the issue

tanmaywadhwa commented 3 years ago

Usually resetting the terminal has fixed this for me. Just run reset on the terminal before launching vim or less or other apps

On Tue, Sep 28, 2021 at 4:10 AM blacktek @.***> wrote:

Hello, I've the same issue using the "less" command on CentOS 7 servers.

I've Win7 pro 64bit with OpenSSH_8.4p1, OpenSSL 1.1.1f 31 Mar 2020

ConEmu 210912

With vi/vim no problem, but less 99% of the times break the output/console as for the person that opened the issue

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Maximus5/ConEmu/issues/1444#issuecomment-929088958, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVFQIXVTZS2ZRQVA62L5NLUEGPB3ANCNFSM4EQCKAYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

blacktek commented 3 years ago

reset and/or clear seem to work in general, but are not very handy. Isn't it possible to fix this issue in ConEMU? with default windows console it doesn't happen.