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

Broken terminal sequences #1624

Open
postwait opened this issue Jun 18, 2020 · 9 comments
Open

Broken terminal sequences #1624

postwait opened this issue Jun 18, 2020 · 9 comments

Comments

@postwait
Copy link

"OpenSSH for Windows" version
8.1.0.1

Server OperatingSystem
Windows 10 Pro

Client OperatingSystem
Linux (CentOS 7, Ubuntu 16/18/20.04)

What is failing
There is a terminal emulation issue with line-shift scrolling. I believe this is the openssh server or windows console incorrectly intercepting terminal control sequences.
From a Linux client (could be in WSL on the same box) to Windows server running WSL2:

ssh -t WindowsBox wsl
vi multipagefile.txt
<downarrow / j many times such that the document must line-scroll>

I've tried with both cmd.exe and Powershell as my default shell for windows.
I've also tried a variety of terminal settings TERM=(xterm|xterm-color256|vt102|vt100)

Expected output
Expected output that the document shifts (all lines)

Actual output
Only the top and bottom line of the document are re-rendered leaving the core contents not-redrawn.

@bagajjal
Copy link
Collaborator

@postwait - I wonder how you got v8.1.0.1. Are you internal to microsoft (or) part of internal ring to get newer version of windows (which is not yet ready for public)?

What vi application did you choose to install on windows?

@postwait
Copy link
Author

I'm on insider fast ring but nothing else special.

I am not using vi on Windows... notice I'm sshing from Linux to Windows and then running wsl to hop into a Linux container on the Windows machine... So:

[Linux] - ssh -> [Windows] - wsl -> [Linux] vi

@bagajjal
Copy link
Collaborator

@postwait - I tried the same scenario. couldn't repro the issue.
From Ubuntu 20.04, I connected to windows machine (ssh.exe -t user@windows_ip wsl) to execute wsl. Then vi some file. I tried down, up, left, right arrow keys and h, j, k, l keys in non-insert mode.. They all worked.. I can see lines scrolling..

Did I get the scenario right?

@postwait
Copy link
Author

That's the scenario... The file last to be more than one page so that the document scrolls up a line when you j past the bottom-most line in the editor. Once the screen is all messed up, if I hit CTRL-l it will repaint and look correct again.

@bagajjal
Copy link
Collaborator

bagajjal commented Jun 18, 2020

@postwait - The document I tried is more than a page. It scrolls and renders properly when the cursor is at the end of page and renders the data correctly. I am using Microsoft Windows [Version 10.0.19041.329]. Please provide the output of cmd on a cmd.exe / powershell.exe. It looks like this,
image

OpenSSH uses console APIs to interpret the VTSeq and render the data correctly. I would like to repro first before involving the console team.

@postwait
Copy link
Author

PS C:\Users\jesus> cmd
Microsoft Windows [Version 10.0.19645.1]
(c) 2020 Microsoft Corporation. All rights reserved.

I'll try to do a quick screen grab

@postwait
Copy link
Author

terminal issue video

I start on the a WSL2 container.. ssh into the host containing it, then invoke wsl to get back into the same container to run the same vi command. At the very end, I hit ctrl-l to refresh the screen

@DHowett
Copy link

DHowett commented Jun 28, 2020

If you're on a version of windows between 19042 and 20000, there was a brief regression in the console APIs that OpenSSH uses to run applications on Windows. 😄

@bagajjal
Copy link
Collaborator

@DHowett - Is there a workaround? Does "Windows terminal" downloaded from store comes with latest and greatest supported conhost?

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

No branches or pull requests

3 participants