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

VSCode's CMD in Windows should automatically erase the entire terminal when full or use ANSI \e[0;4H #142001

Closed
donno2048 opened this issue Feb 2, 2022 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster terminal-conpty Integrated terminal issues related to the ConPTY backend upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues

Comments

@donno2048
Copy link

Basically, I wrote a game in C which works great in windows CMD but buffering in Linux Terminal this issue is solved using \33[0;4H printed at the beginning of each print to set it to the top and erase what was printed using insert mode (equivalent to $ printf '\e[0;4H'), but in VSCode CMD on Windows it's not working...

@Tyriar
Copy link
Member

Tyriar commented Feb 2, 2022

The H sequence you mention moves the cursor, it doesn't erase anything:

CSI Ps ; Ps H
Cursor Position [row;column] (default = [1,1]) (CUP).

Do you mean J or K? Any differences with Windows could be due to how the backend "conpty" works.

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Feb 2, 2022
@donno2048
Copy link
Author

The H sequence you mention moves the cursor, it doesn't erase anything:

Of course, it doesn't erase anything directly, the next print(f) statement replaces the previous text...

@Tyriar
Copy link
Member

Tyriar commented Feb 2, 2022

Ah ok, I suspect this is due to conpty because of the way it renders is not like a regular terminal.


This issue seems to originate from an upstream component and is not something VSCode can fix by making a change to our code. As such, I will go ahead and close it. Please try to reproduce in Windows Terminal and report to microsoft/terminal with repro steps.

If you cannot reproduce in Windows Terminal, chances are it's fixed in a later version of Windows. You can read more about how we consume conpty here. Thanks for understanding.

/label upstream terminal-conpty windows

@Tyriar Tyriar closed this as completed Feb 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster terminal-conpty Integrated terminal issues related to the ConPTY backend upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

4 participants
@Tyriar @meganrogge @donno2048 and others