Repository: PowerShell/Win32-OpenSSH

Issue #1556: Sshd 8.1 on Windows 7 does not move the cursor below line 46
Created: 2020-02-16T17:03:06Z
"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.

Duplicate issue #1591: Rendering issues when connecting from Linux Mint terminal
Created: 2020-04-22T23:47:54Z
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
Server OperatingSystem
Windows Server 2016 Datacenter
What is failing
Rendering is broken when ssh-ing from Linux Mint terminal to windows 2016 running openssh server. I can only get the first 45 lines displayed properly.  Once 45th line is reached the last line starts being overwritten. Please take a look into output that I am getting.
Expected output
`Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
redmond\veljkom@SP-BEAST C:\Users\veljkom>dir
Volume in drive C is Windows
Volume Serial Number is BA52-656C
Directory of C:\Users\veljkom
04/22/2020  12:36 PM              .
04/22/2020  12:36 PM              ..
03/24/2017  08:25 PM              .config
01/19/2017  04:04 PM              .dnx
03/12/2020  12:52 PM              .dotnet
03/22/2019  01:03 PM              .matplotlib
01/27/2017  12:05 PM              .nuget
03/15/2020  12:52 AM              .pylint.d
03/16/2020  09:34 PM                 7 .python_history
04/22/2020  12:37 PM              .ssh
04/16/2020  04:37 PM             1,866 .viminfo
02/21/2020  05:11 PM              .vscode
02/21/2020  12:35 PM              Contacts
03/02/2020  05:16 PM              Desktop
03/12/2020  12:10 PM              Documents
04/22/2020  11:55 AM              Downloads
02/21/2020  12:35 PM              Favorites
02/21/2020  12:35 PM              Links
02/21/2020  12:35 PM              Music
02/21/2020  12:35 PM              Pictures
02/21/2020  12:35 PM              Saved Games
02/21/2020  12:35 PM              Searches
03/12/2020  12:11 PM              source
02/21/2020  12:35 PM              Videos
2 File(s)          1,873 bytes
22 Dir(s)  77,615,083,520 bytes free
redmond\veljkom@SP-BEAST C:\Users\veljkom>dir
Volume in drive C is Windows
Volume Serial Number is BA52-656C
Directory of C:\Users\veljkom
04/22/2020  12:36 PM              .
04/22/2020  12:36 PM              ..
03/24/2017  08:25 PM              .config
01/19/2017  04:04 PM              .dnx
03/12/2020  12:52 PM              .dotnet
03/22/2019  01:03 PM              .matplotlib
01/27/2017  12:05 PM              .nuget
03/15/2020  12:52 AM              .pylint.d
03/16/2020  09:34 PM                 7 .python_history
04/22/2020  12:37 PM              .ssh
04/16/2020  04:37 PM             1,866 .viminfo
02/21/2020  05:11 PM              .vscode
02/21/2020  12:35 PM              Contacts
03/02/2020  05:16 PM              Desktop
03/12/2020  12:10 PM              Documents
04/22/2020  11:55 AM              Downloads
02/21/2020  12:35 PM              Favorites
02/21/2020  12:35 PM              Links
02/21/2020  12:35 PM              Music
02/21/2020  12:35 PM              Pictures
02/21/2020  12:35 PM              Saved Games
02/21/2020  12:35 PM              Searches
03/12/2020  12:11 PM              source
02/21/2020  12:35 PM              Videos
2 File(s)          1,873 bytes
22 Dir(s)  77,615,083,520 bytes free                                                                                                   `
Actual output
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
redmond\veljkom@SP-BEAST C:\Users\veljkom>dir
Volume in drive C is Windows
Volume Serial Number is BA52-656C
Directory of C:\Users\veljkom
04/22/2020  12:36 PM              .
04/22/2020  12:36 PM              ..
03/24/2017  08:25 PM              .config
01/19/2017  04:04 PM              .dnx
03/12/2020  12:52 PM              .dotnet
03/22/2019  01:03 PM              .matplotlib
01/27/2017  12:05 PM              .nuget
03/15/2020  12:52 AM              .pylint.d
03/16/2020  09:34 PM                 7 .python_history
04/22/2020  12:37 PM              .ssh
04/16/2020  04:37 PM             1,866 .viminfo
02/21/2020  05:11 PM              .vscode
02/21/2020  12:35 PM              Contacts
03/02/2020  05:16 PM              Desktop
03/12/2020  12:10 PM              Documents
04/22/2020  11:55 AM              Downloads
02/21/2020  12:35 PM              Favorites
02/21/2020  12:35 PM              Links
02/21/2020  12:35 PM              Music
02/21/2020  12:35 PM              Pictures
02/21/2020  12:35 PM              Saved Games
02/21/2020  12:35 PM              Searches
03/12/2020  12:11 PM              source
02/21/2020  12:35 PM              Videos
2 File(s)          1,873 bytes
22 Dir(s)  77,615,083,520 bytes free
redmond\veljkom@SP-BEAST C:\Users\veljkom>dir
Volume in drive C is Windows
Volume Serial Number is BA52-656C
Directory of C:\Users\veljkom
04/22/2020  12:36 PM              .
04/22/2020  12:36 PM              ..
redmond\veljkom@SP-BEAST C:\Users\veljkom>

Closing comment (2020-04-23T00:19:42Z): Possible duplicate of #1556.
Please test with private binary given in #1556 and confirm.