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

Weird/broken scrollback handling when using tmux at remote ssh host (alternate buffer?) #18357

Open
bago opened this issue Dec 24, 2024 · 2 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@bago
Copy link

bago commented Dec 24, 2024

Windows Terminal version

1.22.3232.0

Windows build number

10.0.19045.5247

Other Software

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 (also tested OpenSSH_for_Windows_9.8p1 Win32-OpenSSH-GitHub, LibreSSL 3.9.2)
tmux 3.2 on the remote host using this tmux.conf:

set-option -ga terminal-overrides ',xterm*:Tc:smcup@:rmcup@'

Steps to reproduce

Open an ssh session to a remote linux host.

test normal scrolling behaviour

for i in $(seq 1 1000); do echo $i; done;

look at the scrollbar and/or try to look at the scroll CTRL+SHIFT+PgUp or the mouse wheel, everything works as expected.

now run the same inside tmux:

tmux
for i in $(seq 1 1000); do echo $i; done;

I can still try to scroll back but I don't find the real output of my loop command.

I tested a lot of terminal emulators for windows and none of them works but Putty: Putty correctly let me scroll back when I'm in tmux the same way I do when I'm outside tmux, and that's why I guessed the issue is in the terminal and not in tmux/tmux configuration (but I know things may be more complex).

Expected Behavior

Being able to scroll previous output pages also when I'm using tmux

Actual Behavior

Previous output pages generated inside tmux are lost (I can see them with tmux internal scrollback but not in a way integrated with Windows Terminal scrolling).

@bago bago added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 24, 2024
@j4james
Copy link
Collaborator

j4james commented Jan 2, 2025

@bago This is related to issue #11078 - tmux uses indn to scroll multiple lines at a time, and that operation doesn't move the scrolled lines into the scrollback on all terminals, including Windows Terminal. You may get better results by altering your tmux terminal-overrides to disable indn like this:

set -g terminal-overrides 'xterm*:smcup@:rmcup@:indn@'

However, be aware that tmux was not intended to be used this way - this is a hack - so there's still no guarantee that you'll see everything in the terminal's scrollback.

@bago
Copy link
Author

bago commented Jan 2, 2025

Thank you! I didn't find the #11078 when I did my searches, but I probably didn't know well what to look for.

Indeed I added the "indn@" override in my tmux.conf and the basic test I proposed in the issue now works fine.

I don't understand the issue enough to decide if I should close this as duplicate of #11078 or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants