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

CLS command does not work in VSCode terminal #190819

Closed
mihailik opened this issue Aug 19, 2023 · 5 comments
Closed

CLS command does not work in VSCode terminal #190819

mihailik opened this issue Aug 19, 2023 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@mihailik
Copy link
Contributor

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.81.1 (user setup)
  • OS Version: Windows_NT x64 10.0.19045

Steps to Reproduce:

  1. open new terminal
  2. type CLS, press Enter
  3. terminal is cleared, all as expected
  4. type dir, press Enter
  5. repeat it 5-7 times until terminal is filled with text and a scrollbar appears
  6. type CLS, press Enter
  7. terminal content scrolled away out of view, but not cleared: you can scroll it back and the content is still there

I think it used to be worse, the CLS didn't clear terminal even at the start. Now it only fails when the existing content overflows.

Quite surprised this bug is missed like that.

If it is a bug in another component, like conpty or Windows itself -- please provide enough info to raise the issue to the corresponding team inside Microsoft. Every piece of code involved here is owned by the company, so leaving it open for so many years is frankly very silly.

@gjsjohnmurray
Copy link
Contributor

I think #176709 and the Stack Overflow post it links to may be relevant to you.

@mihailik
Copy link
Contributor Author

Wow that's one kind of attitude 🤣

image

@mihailik
Copy link
Contributor Author

Of course microsoft/terminal#15065 is as much of a misdirection as xtermjs/xterm.js#1727

There is no need to ship a whole massive library and overhaul some OS subsystem to have a local workaround here.

image

There's a trivial ReadConsoleOutput Win32 API easy to re-sync. How it takes half-decade and dozens of bug reports brushed under the carpet?

@meganrogge meganrogge assigned Tyriar and unassigned meganrogge Aug 22, 2023
@Tyriar
Copy link
Member

Tyriar commented Aug 22, 2023

@mihailik VS Code uses the new pseudoconsole APIs that emulate ptys on unix, not the old Windows console APIs (which ReadConsoleOutput is). It might be possible to sync with that but it would be a hack. It's even discouraged for a related reason in the docs you linked:

This API is not recommended and does not have a virtual terminal equivalent. This decision intentionally aligns the Windows platform with other operating systems where the individual client application is expected to remember its own drawn state for further manipulation. Applications remoting via cross-platform utilities and transports like SSH may not work as expected if using this API.

For microsoft/terminal#15065 I don't think we're tracking it in this repo but will be a priority for us as soon as it happens.


I think you are actually asking for is for the behavior change requested in xtermjs/xterm.js#1727 (which has been labeled with help wanted for 5 years and an easy solution was suggested 2 years ago).

When using new conpty (Windows 11 insider build 22621) here's what happens with cls in pwsh:

Recording 2023-08-22 at 10 06 24

I don't have Windows 10.0.19045 available, could you record a gif to make sure we're on the same page?

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Aug 22, 2023
@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2023
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
Projects
None yet
Development

No branches or pull requests

6 participants
@Tyriar @mihailik @gjsjohnmurray @meganrogge @vscodenpa and others