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: Entire line is reprinted for every prompt character after a space #1647

Closed
Tyriar opened this issue Jun 26, 2019 · 7 comments
Closed
Assignees
Labels
Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 26, 2019

Related: #1646

Environment

Windows build number: Microsoft Windows [Version 10.0.18922.1000]
vscode 1.36.0 insiders

Steps to reproduce

Repros in both cmd and python

  1. Type a
  2. Press space
  3. Repeat

Expected behavior

Only a and space should be sent from conpty until the end of the line is reached

Actual behavior

a�[0K
�[27G
�[?25l
C:\Users\daimms.REDMOND>a a�[0K�[?25h
�[29G
�[?25l
C:\Users\daimms.REDMOND>a a a�[0K�[?25h
�[31G
�[?25l
C:\Users\daimms.REDMOND>a a a a�[0K�[?25h
�[33G
�[?25l
C:\Users\daimms.REDMOND>a a a a a�[0K�[?25h
�[35G
�[?25l
C:\Users\daimms.REDMOND>a a a a a a�[0K�[?25h
�[37G
�[?25l
C:\Users\daimms.REDMOND>a a a a a a a�[0K�[?25h
�[39G
�[?25l
C:\Users\daimms.REDMOND>a a a a a a a a�[0K�[?25h
�[41G
@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 Jun 26, 2019
@DHowett-MSFT DHowett-MSFT added Area-Performance Performance-related issue Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 26, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 26, 2019
@DHowett-MSFT DHowett-MSFT added this to the 20H1 milestone Jun 26, 2019
@zadjii-msft
Copy link
Member

Both of these are horrific and I hope we can get to them soon.

Out of curiosity, does it repro with powershell or wsl? Might be helpful to know if this is related to how COOKED_READ handles the prompt line, or if it's for any scenario like this. (powershell and wsl won't be using COOKED_READ, while cmd will)

@Tyriar
Copy link
Member Author

Tyriar commented Jul 3, 2019

pwsh output:

a
�[m
�a�[m 
�[25l�[7;29Ha�[m a�[?25h
�[25l�[7;29Ha�[m a �[?25h
�[25l�[7;29Ha�[m a a�[?25h
�[25l�[7;29Ha�[m a a �[?25h
�[25l�[7;29Ha�[m a a a�[?25h

wsl output (correct):

a
 
a
 
a
 
a

@zadjii-msft
Copy link
Member

That at least makes me feel better. Looks like it is COOKED_READ related, and if I had to guess, PSReadline redraws the prompt on every character, so that might be out of our control.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 3, 2019

@zadjii-msft hmm... On PSReadline, I'm beginning to think terminals that want to support screen readers well will need to have some buffer diffing as well to avoid reading out prompts when they're reprinted, fish has some fancy auto-complete for example that would probably be awful for screen readers for example and I think zsh might do similar for character attributes.

But this is still a valid report right, cmd.exe shouldn't be reprinting?

@zadjii-msft
Copy link
Member

Oh yea it's definitely still valid. Now I know where to look :)


IIRC the UIA stuff we have in conhost today chokes on things like PSReadline too - taking a larger diff than change-by-change is a good idea, but I'm not super familiar with that code. I doubt it'd be possible with the architecture we currently have. @adiviness can correct me if I'm wrong, and @carlos-zamora may be interested in this side-bar.

@zadjii-msft zadjii-msft self-assigned this Aug 27, 2019
@zadjii-msft
Copy link
Member

@Tyriar Are you still seeing this? When I try booting up python in conpty and following the repro of a a a a a, I get the following:

^[]0;C:\Users\migrie\AppData\Local\Temp\OpenConsole\15550\conhost.exeSPC-SPCpython^G
PythonSPC3.7.3SPC(v3.7.3:ef4ec6ed12,SPCMarSPC25SPC2019,SPC22:22:05)SPC[MSCSPCv.1916SPC64SPCbitSPC(AMD64)]SPConSPCwin32^M^J
TypeSPC"help",SPC"copyright",SPC"credits"SPCorSPC"license"SPCforSPCmoreSPCinformation.^M^J>>>SPC^[[66X
Input "a" [1]
a
Input "SPC" [1]
SPC
Input "a" [1]
a
Input "SPC" [1]
SPC
Input "a" [1]
a
Input "SPC" [1]
SPC

(where SPC is a space)

Similarly, I'm only ever seeing as and s when I do the same thing in cmd.

There were some optimizations that went into conpty around April, but it looks to me like those actually made it to master around 18883.1000.rsmaster.190417-1356. The task/bug/pr I'm looking at are MSFT:20297559, MSFT:21091917, and MSFT:3121537.

@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 Sep 4, 2019
@zadjii-msft zadjii-msft added this to Unprioritized in 20H1 Priority via automation Sep 4, 2019
@zadjii-msft zadjii-msft moved this from Unprioritized to P2 in 20H1 Priority Sep 4, 2019
@DHowett-MSFT DHowett-MSFT added the Priority-2 A description (P2) label Sep 5, 2019
@Tyriar
Copy link
Member Author

Tyriar commented Sep 9, 2019

Fixed in 10.0.18970.1005:

image

@Tyriar Tyriar closed this as completed Sep 9, 2019
@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 9, 2019
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-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty
Projects
No open projects
Development

No branches or pull requests

3 participants