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

Sshd 8.1 on Windows 7 does not move the cursor below line 46 #1556

Closed
mgkuhn opened this issue Feb 16, 2020 · 8 comments
Closed

Sshd 8.1 on Windows 7 does not move the cursor below line 46 #1556

mgkuhn opened this issue Feb 16, 2020 · 8 comments

Comments

@mgkuhn
Copy link

mgkuhn commented Feb 16, 2020

"OpenSSH for Windows" version
8.1.0.0
OpenSSH_for_Windows_8.1p1

Server OperatingSystem
Windows 7 Professional

Client OperatingSystem
Ubuntu Linux 18.04

What is failing
How to reproduce:

  • Open on Linux an xterm window of size 80x50
  • Type ssh windows7host into that xterm window to start an interactive session with cmd.exe on a Windows 7 machine running OpenSSH sshd 8.1p1.
    $ xterm -geometry 80x50 -e 'ssh windows7host'
  • Type commands that produce a lot of lines, such as dir or ipconfig, repeatedly until the cursor reaches the bottom of the window and starts scrolling.
  • Observe if the cursor reaches the bottom of the xterm window and starts scrolling the xterm screen content.

Expected output
When enough lines have been output, the cursor should reach the bottom of the xterm window and then cause it to scroll its screen content upwards.

This is indeed what happens if the xterm window is 46 lines or less high.

Actual output
If the xterm window is more than 46 lines high, my installation of sshd 8.1p1 on Windows 7 does not allow the cursor to go below line 46. Once the cursor has reached line 46, it stays in that line, with new lines overwriting previous lines there. As the cursor never reaches the bottom of the xterm window, it does not scroll. Additional command output remains unreadable as a result, until I type cls to move the cursor back to the top of the screen.

@mgkuhn
Copy link
Author

mgkuhn commented Feb 16, 2020

This problem does not occur on Windows 10. We still have expensive scientific equipment that runs Windows 7 and cannot be upgraded, hence the desire to use sshd there.

@mgkuhn
Copy link
Author

mgkuhn commented Feb 16, 2020

See also: #938 #1283
Problem also happens with larger xterm sizes, e.g. xterm -geometry 100x50 -e 'ssh windows7host'

@bagajjal
Copy link
Collaborator

@mgkuhn - Thank you for reporting this issue. This is a regression caused in openssh v8.1.
I will fix this for next openssh version. Meanwhile please use the attached private ssh-shellhost binary. You just need to replace ssh-shellhost.exe with my private binary.

@bokeron2020
Copy link

@mgkuhn - Thank you for reporting this issue. This is a regression caused in openssh v8.1.
I will fix this for next openssh version. Meanwhile please use the attached private ssh-shellhost binary. You just need to replace ssh-shellhost.exe with my private binary.

@bagajjal your private binary helps a lot, thank you. It doesn't solve it completely, though. During a long session with MANY lines, it reaches a point where the terminal starts to behave weirdly again.

@bagajjal
Copy link
Collaborator

bagajjal commented Apr 2, 2020

@bokeron2020 - This is a known issue for win10 below when you end up hitting 9999 lines.
For downlevel OS (win10 /winserver 2019 below), we don't have the true pty console support so we have a minimal version of pty implemented by tracking changes to console by ourself.
Unfortunately we are not investing fixing these kind of issues as we have much better user interface in windows 10 with lot of support from windows console team.

@bokeron2020
Copy link

@bagajjal Oh, I see. Well, I have to stick to Windows 7 due to old software restraints so I'll live with it and thanks to your work its much more bearable now. Thank you.

@mgkuhn
Copy link
Author

mgkuhn commented Apr 3, 2020

@bagajjal That's fine, as long as the 9999 limit is well documented. It should probably be mentioned at https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH

@maertendMSFT
Copy link
Collaborator

We have updated the wiki and the fix will be in the next release.

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

No branches or pull requests

4 participants