Display problem when using "less" command #12935

Closed
opened 2026-01-31 03:29:23 +00:00 by claunia · 11 comments
Owner

Originally created by @TypicalSEE on GitHub (Mar 10, 2021).

Windows: Microsoft Windows [版本 10.0.19041.804]
Terminal: 1.6.10571.0

Hi, I'm using OpenSSH to connect to a remote Linux server under Windows Terminal. But the output of "less -SN" seems not normal. The first screenshot shows it: the 19th line appears besides the 1st line. The second screenshot is the normal output (after I quit and type that command again). Unexpected output were not about a fixed line. Sometimes it's the 1st line overlapping with another line but other times it was some other lines repeating themselves. I had been using Putty to connect to a remote servers before but nerver met this problem so I think it might be a bug of Windows Terminal. Thanks.
issue

normal

Originally created by @TypicalSEE on GitHub (Mar 10, 2021). Windows: Microsoft Windows [版本 10.0.19041.804] Terminal: 1.6.10571.0 Hi, I'm using OpenSSH to connect to a remote Linux server under Windows Terminal. But the output of "less -SN" seems not normal. The first screenshot shows it: the 19th line appears besides the 1st line. The second screenshot is the normal output (after I quit and type that command again). Unexpected output were not about a fixed line. Sometimes it's the 1st line overlapping with another line but other times it was some other lines repeating themselves. I had been using Putty to connect to a remote servers before but nerver met this problem so I think it might be a bug of Windows Terminal. Thanks. ![issue](https://user-images.githubusercontent.com/22927497/110595671-47e42900-81b9-11eb-8157-7431ac5bbaa6.png) ![normal](https://user-images.githubusercontent.com/22927497/110595697-4f0b3700-81b9-11eb-82e5-c67261681a66.png)
Author
Owner

@zadjii-msft commented on GitHub (Mar 10, 2021):

@TypicalSEE Which version of ssh are you using?

@zadjii-msft commented on GitHub (Mar 10, 2021): @TypicalSEE Which version of `ssh` are you using?
Author
Owner

@DHowett commented on GitHub (Mar 10, 2021):

This sounds like #9176.

@DHowett commented on GitHub (Mar 10, 2021): This sounds like #9176.
Author
Owner

@TypicalSEE commented on GitHub (Mar 11, 2021):

@TypicalSEE Which version of ssh are you using?

"OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5", installed from Windows 10 “Optional Feature”.

@TypicalSEE commented on GitHub (Mar 11, 2021): > @TypicalSEE Which version of `ssh` are you using? "OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5", installed from Windows 10 “Optional Feature”.
Author
Owner

@DHowett commented on GitHub (Mar 11, 2021):

In that case, I suspect that you're hitting the screen size change buffering issue in https://github.com/PowerShell/openssh-portable/pull/426. Even though it doesn't look like the screen size is changing, less is turning on the "alternate buffer" which reports a window resize. OpenSSH, until pull 426, had trouble handling the resize event.

If you run OpenSSH 8.1 from the win32-openssh releases page, does it go away?

@DHowett commented on GitHub (Mar 11, 2021): In that case, I suspect that you're hitting the screen size change buffering issue in https://github.com/PowerShell/openssh-portable/pull/426. Even though it doesn't look like the screen size is changing, less is turning on the "alternate buffer" which reports a window resize. OpenSSH, until pull 426, had trouble handling the resize event. If you run OpenSSH 8.1 from the [win32-openssh releases page](https://github.com/PowerShell/Win32-OpenSSH/releases), does it go away?
Author
Owner

@TypicalSEE commented on GitHub (Mar 12, 2021):

Downloaded OpenSSH 8.1 from that page and tried it, the problem still exists. By the way, ssh version of my remote server is "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017". Should I also upgrade that one?

@TypicalSEE commented on GitHub (Mar 12, 2021): Downloaded OpenSSH 8.1 from that page and tried it, the problem still exists. By the way, ssh version of my remote server is "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017". Should I also upgrade that one?
Author
Owner

@jdebp commented on GitHub (Mar 12, 2021):

Three answers will help the Microsoft (and other) people:

  • Does this happen as you scroll up and down? Or initially when less first displays the file?
  • What happens when you tell less to redraw the screen?
  • What is the value of the TERM environment variable on the system that is actually running the less program?
@jdebp commented on GitHub (Mar 12, 2021): Three answers will help the Microsoft (and other) people: * Does this happen as you scroll up and down? Or initially when `less` first displays the file? * What happens when you tell `less` to redraw the screen? * What is the value of the `TERM` environment variable on the system that is actually running the `less` program?
Author
Owner

@DHowett commented on GitHub (Mar 12, 2021):

I apologize. The pull request that fixes the buffering/repeat issue merged on April 2, 2020 but the 8.1 release came out in Dec 2019. I do not know why I thought it might help. 😄

@DHowett commented on GitHub (Mar 12, 2021): I apologize. The pull request that fixes the buffering/repeat issue merged on April 2, 2020 but the 8.1 release came out in Dec 2019. I do not know why I thought it might help. :smile:
Author
Owner

@zadjii-msft commented on GitHub (Nov 23, 2021):

@TypicalSEE There's now an OpenSSH 8.6 (https://github.com/PowerShell/Win32-OpenSSH/releases/tag/V8.6.0.0p1-Beta), mind trying that one? We think that might have the fix

@zadjii-msft commented on GitHub (Nov 23, 2021): @TypicalSEE There's now an OpenSSH 8.6 (https://github.com/PowerShell/Win32-OpenSSH/releases/tag/V8.6.0.0p1-Beta), mind trying that one? We think that might have the fix
Author
Owner

@ghost commented on GitHub (Nov 28, 2021):

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 (Nov 28, 2021): 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

@sarbian commented on GitHub (Nov 28, 2021):

I had a similar issue and that version fixed it.

@sarbian commented on GitHub (Nov 28, 2021): I had a similar issue and that version fixed it.
Author
Owner

@zadjii-msft commented on GitHub (Nov 29, 2021):

I'll count that, thanks for confirming!

@zadjii-msft commented on GitHub (Nov 29, 2021): I'll count that, thanks for confirming!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12935