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

conpty exhibits pathological performance on scrolling region redraw (repaints entire screen) #7019

Closed
Tracked by #5228
izghitu opened this issue Jul 22, 2020 · 18 comments
Labels
Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty
Milestone

Comments

@izghitu
Copy link

izghitu commented Jul 22, 2020

Environment

Windows build number: Win32NT             10.0.18362.0 Microsoft Windows NT 10.0.18362.0
Windows Terminal version (if applicable): latest

Steps to reproduce

ssh into a remote host, execute a command that spits a lot of output

Expected behavior

In putty when the connection to a remote host is slow and a command spits a lot of output and that output comes back in frames(due to the slow connection) then I can just fine switch between SCREEN tabs. In windows terminal this is not possible. I am not even able to switch between tabs of the windows terminal until the command previous executed does not finish its output.

Actual behavior

Need to wait for full command output before I can do anything else in the windows terminal.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 22, 2020
@jblaine
Copy link

jblaine commented Aug 5, 2020

@izghitu I believe your report is a duplicate of #6258 which is specifically about Ctrl-C but I am sure that same situation applies to any control sequence, like those used in GNU screen.

@zadjii-msft
Copy link
Member

@izghitu Which ssh are you using? The ssh.exe that ships with Windows, or one from WSL (or some other one)? And which version?

Also latest doesn't really help as a version number, because at the time of your post, latest could have either meant 1.0, 1.1, or 1.2, depending if you were on the preview or release builds, and if you had gotten the release that shipped on the 22nd. Which WT version number exactly?

@jblaine this doesn't really sound like it's related to Ctrl+C to me at all. Here OP is just trying to switch tabs in screen, which isn't working (and is reasonable if the output is being heavily buffered), nor is switching Terminal tabs (which is really quite surprising)

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 5, 2020
@zadjii-msft zadjii-msft added the Area-Performance Performance-related issue label Aug 5, 2020
@izghitu
Copy link
Author

izghitu commented Aug 5, 2020

@zadjii-msft I use the ssh.exe that ships with WIndows. Its location is:

C:\\Windows\\System32\\OpenSSH\\ssh.exe

The version of the WT is Version: 1.1.2021.0

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 5, 2020
@zadjii-msft
Copy link
Member

Some other questions from #7191:

  • Does this repro without tmux/screen running on the remote host?
  • Does this repro with the ssh from a WSL distro?
  • More insane - if you run wsl.exe ssh.exe <args to ssh...> inside a legacy powershell/cmd window, does the same issue repro? This will cause wsl to create a conpty to host ssh.exe, which could help identify if the issue is conpty vs something else.

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Aug 5, 2020
@jblaine
Copy link

jblaine commented Aug 5, 2020

@zadjii-msft My hour of testing showed the following for what I'm experiencing.

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

Windows 10 native ssh client
Remote Linux host running either tmux or GNU screen, multiple versions all work to reproduce issue

Connect via Windows 10 ssh (under Terminal) to a remote host. At the remote host, run a new screen or tmux session OR re-attach to an existing one. Generate a lot of output from a shell in one of the screen or tmux windows. Terminal crawls in batches of text displayed and often becomes unresponsive for periods of time. In my particular case, I am using a Terminal profile with commandLine of "ssh <my args>"

The same behavior can be seen in a WSL distro using the distro's SSH connected to the remote host + attach to screen + cat big file.

It does not happen when running a bare CMD.EXE (outside of Terminal) and then wsl.exe ssh.exe <args to ssh...> + screen resume + cat big file.

After digging around in the open issues here and finding some other issue about slow rendering when colors are at play, I even tested when TERM=vt100 on the remote end and all coloring turned off. The performance issue still exists in that case, so it does not seem to have to do anything with that other color perf. issue.

@zadjii-msft
Copy link
Member

It does not happen when running a bare CMD.EXE (outside of Terminal) and then wsl.exe ssh.exe <args to ssh...> + screen resume + cat big file.

Well that pretty specifically rules out a whole bunch of possible sources of this issue actually. That narrows it down to specifically the Terminal, and rules out conpty, ssh.exe, and screen as possible sources of error.

That being said, I wonder what about the terminal is causing the stuttering. XAML? DX? Scrollbar updating?

Does setting "historySize":0 in your profile help at all? That'll disable scrollback, but might help narrow it down further.

There are also a pair of global renderer settings that might be able to help rule out DX. Does setting either of these to true in the global settings (outside of a profile) change anything?

  • experimental.rendering.forceFullRepaint
  • experimental.rendering.software

@jblaine
Copy link

jblaine commented Aug 5, 2020

No, none of those helped.

@lucastheisen

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 9, 2020
@ghost
Copy link

ghost commented Aug 9, 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 ghost closed this as completed Aug 12, 2020
@jblaine
Copy link

jblaine commented Aug 13, 2020

This should be reopened, please

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 13, 2020
@DHowett
Copy link
Member

DHowett commented Aug 13, 2020

Thanks. Our bot should be taught to recognize any commenter who can provide additional information.

One more question - are you using a status line in screen or tmux?

@DHowett DHowett reopened this Aug 13, 2020
@jblaine
Copy link

jblaine commented Aug 13, 2020

Thanks @DHowett. Yes, I do use a statusline in screen. My tmux testing was only for this issue. I don't use tmux in my daily life.

@DHowett
Copy link
Member

DHowett commented Aug 13, 2020

Okay, excellent. Thanks.

We have a pathological redraw case when there are sub-full-screen scrolling regions active (like, where there’s a status line). We end up retransmitting the entire contents of the screen for every line between the backend and frontend processes in Terminal. The contention on the output queue bogs down the input queue.

@DHowett
Copy link
Member

DHowett commented Aug 13, 2020

I believe we have another version of this lying around somewhere, so I’ll assign myself to deduplicate.

@DHowett DHowett self-assigned this Aug 13, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 13, 2020
@DHowett DHowett added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 13, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 23, 2020
@DHowett DHowett changed the title Screen lock when waiting for output from command conpty pathological performance on scrolling region redraw (repaints entire screen) Oct 23, 2020
@DHowett DHowett changed the title conpty pathological performance on scrolling region redraw (repaints entire screen) conpty exhibits pathological performance on scrolling region redraw (repaints entire screen) Oct 23, 2020
@zadjii-msft
Copy link
Member

Just messaged Dustin about this - turns out there's not another dupe for this one! This is now the tracking thread for this issue. Thanks!

@DHowett DHowett added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Oct 23, 2020
@zadjii-msft zadjii-msft removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 23, 2020
@DHowett DHowett added this to the Terminal Backlog milestone Oct 23, 2020
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

Wait this might actually be #5228 after all. Or, at least, should be tracked as part of it. @DHowett back me up?

@zadjii-msft
Copy link
Member

I'm pretty sure this is /dup #%228 after all.

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

No branches or pull requests

5 participants