Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mintty update broke scrollback buffer support in left/right margins mode with default margins #916

Closed
pa-jberanek opened this issue Sep 20, 2019 · 15 comments

Comments

@pa-jberanek
Copy link

So, I was previously using wsltty 1.9.6, connecting to a CentOS 7 server where I had tmux installed, and configured to disable the alternate screen buffer, so I could still use what I consider to be a valuable fast local scrollback (with Shift-PageUp/Down or scrollbar), and all was good.

Recently I updated to wsltty 3.0.2, and this has stopped working. It's annoyed me enough that I've gone back to using PuTTY, but I do still prefer the wsltty solution generally.

Tmux is configured with the following to disable the alternate screen buffer:

set -ga terminal-overrides ",xterm*:smcup@:rmcup@,putty*:smcup@:rmcup@,screen*:smcup@:rmcup@"

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 20, 2019

Are you using Windows Subsystem for Linux (WSL) to connect to that server? If not then use normal cygwin or msys2 installation.

@pa-jberanek
Copy link
Author

Yes, I run WSL inside mintty with wsltty, and from there connect to Linux servers.

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 20, 2019

What is the Windows 10 version?

@pa-jberanek
Copy link
Author

I'm on 1903 (18362)

@Biswa96
Copy link
Contributor

Biswa96 commented Sep 20, 2019

Hand over to @mintty.

@mintty
Copy link
Owner

mintty commented Sep 22, 2019

configured to disable the alternate screen buffer

Configured mintty (SuppressSGR or NoAltScreen) or only via tmux?

Tmux is configured with the following to disable the alternate screen buffer:

Tmux on WSL or on the CentOS server?

Please try NoAltScreen=true in %APPDATA%\wsltty\config.
Did you change anything (e.g. tmux upgrade) on the server side about the same time?
Can you activate a screen log, to check whether the switching sequences were/are being sent?
Can you describe the test case more precisely...?

@pa-jberanek
Copy link
Author

pa-jberanek commented Sep 22, 2019

I've not configured mintty for anything alternate buffer related.

The tmux is on the CentOS server, and I've not changed the version there.

I can try and capture a log of me reproducing it. All I do is:

On wsltty session, SSH to the Linux server
Start fresh tmux session
Do 'ls /usr/bin' to put some data in my scrollback
Attempt Shift-PageUp or scrollbar moving

All I see is the session from before I started tmux, and nothing of the overflowed 'ls' output.

@pa-jberanek
Copy link
Author

Setting NoAltScreen=true didn't change the behaviour. Attached is a capture from 'script' on the WSL instance.
typescript.gz

@mintty
Copy link
Owner

mintty commented Sep 23, 2019

Ah, I've got a suspicion. Can you make the same typescript with the previous wsltty version to compare?
Is there actually a tool to replay that in real-time?
Anyway, mintty 3.0.1 added support for VT420 left/right margin mode, and that mode is set in the typescript. When scrolling in margin mode, lines scrolled out are not put into the scrollback buffer (because normally, not whole lines but only partial lines would be scrolled).

Now we could investigate why your tmux uses margin mode now and did not before (or to check whether it tried in the first place, thus my request above).

Also, I'm actually wondering: if you want to use local scrollback, why do you use tmux at all?

@mintty
Copy link
Owner

mintty commented Sep 23, 2019

The log contains the sequence \e[?69h\e[1;36r\e[s which sets left/right margins to their default.
This makes no sense, it's better to run with left/right margins mode disabled.
Therefore I consider this a bug of the application, tmux.
On the other hand, xterm handles this special case and maintains the scrollback buffer, so mintty can change that too.

@mintty mintty changed the title mintty update broke disabling of alternate screen buffer in tmux mintty update broke scrollback buffer support in left/right margins mode with default margins Sep 23, 2019
mintty added a commit that referenced this issue Sep 23, 2019
…gins (#916);

do not put cleared lines into scrollback buffer
@pa-jberanek
Copy link
Author

To answer your question why I run tmux at all: I run it so that I can maintain 10 persistent consoles on a remote server, so I'm not reliant on connections being continuously open on my workstation.

It's still much faster/more natural to use a local scrollback buffer, though presumably I could fix the "naturalness" by changing tmux's keybindings for scrolling.

@pa-jberanek
Copy link
Author

So, downgrading to wsltty 1.9.6/mintty 2.9.6 does return the previous behaviour, typescript attached.

typescript-mintty-2.9.6.gz

@mintty
Copy link
Owner

mintty commented Sep 26, 2019

In the "older" log, left/right margin mode is in fact not activated. This is weird if you really changed nothing else. Does the application perhaps check the mintty version?
Anyway, mintty will be changed to catch this case in the next version.

@mintty
Copy link
Owner

mintty commented Sep 26, 2019

Released 3.0.3.

@mintty mintty closed this as completed Sep 26, 2019
@pa-jberanek
Copy link
Author

Thanks, verified with mintty 3.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants