How to enable scrollback when using tmux in ssh? #9983

Closed
opened 2026-01-31 02:09:19 +00:00 by claunia · 21 comments
Owner

Originally created by @daldr-ntml on GitHub (Aug 3, 2020).

Windows build number: Microsoft Windows [Version 10.0.18362.778]
Windows Terminal version (if applicable): Version: 1.1.2021.0

When running tmux in an ssh session (connected to a Centos 7 machine) tmux works ok except that scrollback does not work.

Is there a way to enable scrollback when using tmux in Terminal?

(I think #381 may be relevant but I don't understand it).

Originally created by @daldr-ntml on GitHub (Aug 3, 2020). ```none Windows build number: Microsoft Windows [Version 10.0.18362.778] Windows Terminal version (if applicable): Version: 1.1.2021.0 ``` When running tmux in an ssh session (connected to a Centos 7 machine) tmux works ok except that scrollback does not work. Is there a way to enable scrollback when using tmux in Terminal? (I think #381 may be relevant but I don't understand it).
Author
Owner

@zadjii-msft commented on GitHub (Aug 3, 2020):

Does tmux support using the scrollback in any terminal emulator? I was under the impression that it always maintained it's own internal scrollback, and didn't use the terminal emulator's, since there's no real way that you can use the terminal scrollback for multiple panes in a sensible way

@zadjii-msft commented on GitHub (Aug 3, 2020): Does `tmux` support using the scrollback in _any_ terminal emulator? I was under the impression that it always maintained it's own internal scrollback, and didn't use the terminal emulator's, since there's no real way that you can use the terminal scrollback for multiple panes in a sensible way
Author
Owner

@DHowett commented on GitHub (Aug 3, 2020):

This might be related to the issue where scrolling regions that take up the entire screen don't push lines off the top properly. I can't recall which that is at the moment.

@DHowett commented on GitHub (Aug 3, 2020): This might be related to the issue where scrolling regions that take up the entire screen don't push lines off the top properly. I can't recall which that is at the moment.
Author
Owner

@DHowett commented on GitHub (Aug 3, 2020):

@DavidA2014

When running tmux in an ssh session (connected to a Centos 7 machine) tmux works ok except that scrollback does not work.

Actually, you know what? I think I know what this is. tmux supports mouse scrolling using VT mouse mode.
David, are you using the version of ssh that comes with windows? Can you share the output of ssh -V?

@DHowett commented on GitHub (Aug 3, 2020): @DavidA2014 > When running tmux in an ssh session (connected to a Centos 7 machine) tmux works ok except that scrollback does not work. Actually, you know what? I think I know what this is. tmux supports mouse scrolling using VT mouse mode. David, are you using the version of ssh that comes with windows? Can you share the output of `ssh -V`?
Author
Owner

@daldr-ntml commented on GitHub (Aug 4, 2020):

@DHowett

>ssh -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
@daldr-ntml commented on GitHub (Aug 4, 2020): @DHowett ``` >ssh -V OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 ```
Author
Owner

@DHowett commented on GitHub (Aug 5, 2020):

That will do it! The version of SSH that comes with Windows doesn't support sending your mouse input to the other end of the wire (so tmux never knows you're trying to scroll.)

If you give a try to the newer version, 8.2+, from their releases page, does it work better?

@DHowett commented on GitHub (Aug 5, 2020): That will do it! The version of SSH that comes with Windows doesn't support sending your mouse input to the other end of the wire (so tmux never knows you're trying to scroll.) If you give a try to the newer version, 8.2+, from [their releases page](https://github.com/powershell/win32-openssh/releases), does it work better?
Author
Owner

@daldr-ntml commented on GitHub (Aug 5, 2020):

@DHowett Thanks, but did you mean 8.2+? I can't see anything later than 8.1.

@daldr-ntml commented on GitHub (Aug 5, 2020): @DHowett Thanks, but did you mean 8.2+? I can't see anything later than 8.1.
Author
Owner

@DHowett commented on GitHub (Aug 5, 2020):

8.1 should be sufficient. Sorry about that, I forgot what version they were on :)

@DHowett commented on GitHub (Aug 5, 2020): 8.1 should be sufficient. Sorry about that, I forgot what version they were on :)
Author
Owner

@daldr-ntml commented on GitHub (Aug 5, 2020):

Thanks. I'm also a bit worried about installing a custom version, now that Windows comes with OpenSSH. I've tried the PowerShell installation commands for OpenSSH in the past and they've not worked for me. Any advice? (Don't worry if you haven't).

@daldr-ntml commented on GitHub (Aug 5, 2020): Thanks. I'm also a bit worried about installing a custom version, now that Windows comes with OpenSSH. I've tried the PowerShell installation commands for OpenSSH in the past and they've not worked for me. Any advice? (Don't worry if you haven't).
Author
Owner

@DHowett commented on GitHub (Aug 5, 2020):

That's a fair concern. I'm not sure how best to install it or to make sure that it's working properly across your system.

If you want to give it a quick test just to verify before jumping in, you can just run ssh.exe right out of the zip file (or, well, extract it somewhere first 😄).

@DHowett commented on GitHub (Aug 5, 2020): That's a fair concern. I'm not sure how best to install it or to make sure that it's working properly across your system. If you want to give it a quick test just to verify before jumping in, you can just run `ssh.exe` right out of the zip file (or, well, extract it somewhere first :smile:).
Author
Owner

@WSLUser commented on GitHub (Aug 6, 2020):

https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH has always worked for me every release (minus firewall rules, which only need to be put in once.) You can also run through these scripts if something seems off afterwards: https://github.com/PowerShell/Win32-OpenSSH/wiki/OpenSSH-utility-scripts-to-fix-file-permissions. Ignore the module portion, that part has been officially depreciated.

@WSLUser commented on GitHub (Aug 6, 2020): https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH has always worked for me every release (minus firewall rules, which only need to be put in once.) You can also run through these scripts if something seems off afterwards: https://github.com/PowerShell/Win32-OpenSSH/wiki/OpenSSH-utility-scripts-to-fix-file-permissions. Ignore the module portion, that part has been officially depreciated.
Author
Owner

@ghost commented on GitHub (Aug 10, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 10, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@daldr-ntml commented on GitHub (Aug 11, 2020):

@WSLUser Thanks for your answer. We used the instructions that you linked to and successfully installed OpenSSH_for_Windows_8.1p1.

Just for the record, the default version of ssh provided by Windows is at:
C:\Windows\System32\OpenSSH\ssh.exe

The version installed by the instructions from https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH is at:
"C:\Program Files\OpenSSH\ssh.exe"

@daldr-ntml commented on GitHub (Aug 11, 2020): @WSLUser Thanks for your answer. We used the instructions that you linked to and successfully installed OpenSSH_for_Windows_8.1p1. Just for the record, the default version of ssh provided by Windows is at: C:\Windows\System32\OpenSSH\ssh.exe The version installed by the instructions from [https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH](url) is at: "C:\Program Files\OpenSSH\ssh.exe"
Author
Owner

@daldr-ntml commented on GitHub (Aug 11, 2020):

It seems that even with OpenSSH_for_Windows_8.1p1, scrollback is not working properly with tmux in Terminal.

@daldr-ntml commented on GitHub (Aug 11, 2020): It seems that even with OpenSSH_for_Windows_8.1p1, scrollback is not working properly with tmux in Terminal.
Author
Owner

@zadjii-msft commented on GitHub (Aug 11, 2020):

How are you attempting to scroll to the scrollback - with the mouse wheel, or a keybinding in tmux? If you're trying to use the mouse, do you have mouse support enabled in your tmux config?

Does the scrollback work if you try ssh'ing from a vintage console window (i.e. cmd.exe)?

@zadjii-msft commented on GitHub (Aug 11, 2020): How are you attempting to scroll to the scrollback - with the mouse wheel, or a keybinding in `tmux`? If you're trying to use the mouse, do you have mouse support enabled in your `tmux` config? Does the scrollback work if you try ssh'ing from a vintage console window (i.e. `cmd.exe`)?
Author
Owner

@WSLUser commented on GitHub (Aug 11, 2020):

Just to take away another factor, did you uninstall the Optional Feature version of OpenSSH? In theory you should be able to use both but in practice it's better to use only one version, typically the latest in the case of OpenSSH. Your PATH may still be using the old version, so uninstalling it should help ensure that isn't the case. Also be sure to bump the 8.1 release near the top of your PATH (the UI is quite useful for this).

@WSLUser commented on GitHub (Aug 11, 2020): Just to take away another factor, did you uninstall the Optional Feature version of OpenSSH? In theory you should be able to use both but in practice it's better to use only one version, typically the latest in the case of OpenSSH. Your PATH may still be using the old version, so uninstalling it should help ensure that isn't the case. Also be sure to bump the 8.1 release near the top of your PATH (the UI is quite useful for this).
Author
Owner

@daldr-ntml commented on GitHub (Aug 11, 2020):

@WSLUser @zadjii-msft Thanks for your comments, I can't investigate further just at the moment.

@WSLUser what did you mean by:

(the UI is quite useful for this).

?

@daldr-ntml commented on GitHub (Aug 11, 2020): @WSLUser @zadjii-msft Thanks for your comments, I can't investigate further just at the moment. @WSLUser what did you mean by: ``` (the UI is quite useful for this). ``` ?
Author
Owner

@WSLUser commented on GitHub (Aug 11, 2020):

EnvVaredit

@WSLUser commented on GitHub (Aug 11, 2020): ![EnvVaredit](https://user-images.githubusercontent.com/33032910/89922905-3f118180-dbef-11ea-9d79-eddbdd93e31f.PNG)
Author
Owner

@ghost commented on GitHub (Aug 15, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 15, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@kellytrinh commented on GitHub (Aug 18, 2020):

Can confirm that installing latest of OpenSSH (v8.1 from the website) fixes the issue with tmux getting the mouse scroll wheel commands.

The path thing didn't work even when put at the top of the list (but perhaps I was missing a reboot in the middle) - by default I would still get the Windows 10 installed v7.2 when ssh from a command prompt.

I was perhaps a bit rash and just uninstalled the optional feature "SSH Client" but no issues - it worked fine and now a bear ssh from the command prompt will launch v8.1 and then testing out tmux and scrolls back in history fine.

@kellytrinh commented on GitHub (Aug 18, 2020): Can confirm that installing latest of OpenSSH (v8.1 from the website) fixes the issue with tmux getting the mouse scroll wheel commands. The path thing didn't work even when put at the top of the list (but perhaps I was missing a reboot in the middle) - by default I would still get the Windows 10 installed v7.2 when `ssh` from a command prompt. I was perhaps a bit rash and just uninstalled the optional feature "SSH Client" but no issues - it worked fine and now a bear `ssh` from the command prompt will launch v8.1 and then testing out tmux and scrolls back in history fine.
Author
Owner

@ghost commented on GitHub (Aug 22, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 22, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@xaeiougit commented on GitHub (Sep 19, 2020):

It seems that even with OpenSSH_for_Windows_8.1p1, scrollback is not working properly with tmux in Terminal.

@WSLUser @zadjii-msft @DavidA2014

It's working fine for me using tmux in Windows Terminal. I didn't want to install it either, so all I did was copied the ssh.exe (and only that file) from the zip at:

https://github.com/powershell/win32-openssh/releases

Into a directory in my path so it's used rather than the installed version.

If it's not working for you, maybe check you tmux settings as indicated by zadjii-msft .

@xaeiougit commented on GitHub (Sep 19, 2020): > It seems that even with OpenSSH_for_Windows_8.1p1, scrollback is not working properly with tmux in Terminal. @WSLUser @zadjii-msft @DavidA2014 It's working fine for me using tmux in Windows Terminal. I didn't want to install it either, so all I did was copied the ssh.exe (and only that file) from the zip at: https://github.com/powershell/win32-openssh/releases Into a directory in my path so it's used rather than the installed version. If it's not working for you, maybe check you tmux settings as indicated by zadjii-msft .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9983