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

Closed
opened 2026-01-31 08:20:56 +00:00 by claunia · 4 comments
Owner

Originally created by @bago on GitHub (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).

Originally created by @bago on GitHub (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).
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 08:20:56 +00:00
Author
Owner

@j4james commented on GitHub (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.

@j4james commented on GitHub (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.
Author
Owner

@bago commented on GitHub (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.

@bago commented on GitHub (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.
Author
Owner

@DHowett commented on GitHub (Jan 6, 2025):

Thanks James for triage and bago for testing indn.

I'll mark this one up as a duplicate since it looks like it involves the same termcap.

/dup #11078

@DHowett commented on GitHub (Jan 6, 2025): Thanks James for triage and bago for testing `indn`. I'll mark this one up as a duplicate since it looks like it involves the same termcap. /dup #11078
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jan 6, 2025):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Jan 6, 2025): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22698