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

The cls command doesn't clear the terminal (Windows 10 1903, ConPTY) #72708

Closed
tnnmigga opened this issue Apr 22, 2019 · 22 comments · Fixed by #74858
Closed

The cls command doesn't clear the terminal (Windows 10 1903, ConPTY) #72708

tnnmigga opened this issue Apr 22, 2019 · 22 comments · Fixed by #74858
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label terminal-conpty Integrated terminal issues related to the ConPTY backend verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@tnnmigga
Copy link

tnnmigga commented Apr 22, 2019

Issue Type: Bug
I update my windows 10 to 1903 today.
The terminal will show
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
when I open the terminal.
image

some message is useless,so I want to clear it,and I find the bug when I enter cls
image
image
image

and please delete that"尝试新的跨平台 PowerShell https://aka.ms/pscore6"

VS Code version: Code 1.33.1 (51b0b28, 2019-04-11T08:27:14.102Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (4 x 2712)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.86GB (4.19GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none (1 theme extensions excluded)
@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Apr 22, 2019
@tnnmigga
Copy link
Author

cmd alse exist bug
image
image

@tnnmigga
Copy link
Author

tnnmigga commented Apr 22, 2019

and sometimes I close terminal will meet it when I use cmd terminal
image

image

it very frequent!
I just open terminal and input cls and close terminal,then it begin,and don't need any other operation
image
image

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug windows VS Code on Windows issues terminal-conpty Integrated terminal issues related to the ConPTY backend labels Apr 22, 2019
@mooretc2
Copy link

I just tested this with both cmd and PS on Windows and cls worked as expected for me. Can you give any more information on your setup?

@tnnmigga
Copy link
Author

tnnmigga commented Apr 25, 2019

I just tested this with both cmd and PS on Windows and cls worked as expected for me. Can you give any more information on your setup?

This is my windows 10 pro version 1903 iso download link

ed2k://%7Cfile%7Ccn_windows_10_consumer_editions_version_1903_x64_dvd_8f05241d.iso%7C4905476096%7CF28FDC23DA34D55BA466BFD6E91DD311%7C/

and language is Simplified Chinese
PowerShell problem has been solved when I update windows
but cmd still has the problem

@Tyriar
Copy link
Member

Tyriar commented Apr 25, 2019

I can reproduce it, it happens sometimes on shells using ConPTY. Needs more investigation as to why. Comparing good/bad logs using this is where I would start if anyone wants to take a stab at this one.

@aqez
Copy link

aqez commented Apr 26, 2019

Also happens for me. I've tried different shells (cmd, powershell, git bash) all on windows, as well as different renderers (canvas and dom for each). Doesn't appear to affect my linux machine though.
image

Edit: Turns out this was related to #33730 for me. I was launching vscode from git bash, which is known to cause the vscode terminal not to clear correctly. When launching via any other method it appears to work correctly.

@starship863
Copy link

starship863 commented Apr 30, 2019

Thank you @Tyriar for the tremendous progress on Conpty!

I can also confirm this bug with both git-bash and wsl bash terminals on my Windows 1903.

It happens in my environment EVERYTIME.

Anything that we can do to help tackling this problem?

@Tyriar
Copy link
Member

Tyriar commented Apr 30, 2019

@starship863 first step is to validate that ConPTY is indeed sending the wrong data by investigating logs of when it works and when it doesn't using the https://github.com/Microsoft/vscode/wiki/Terminal-Issues#enabling-escape-sequence-logging, if ConPTY is in the wrong we should them move this issue up to https://github.com/Microsoft/console. We should validate here first though as I don't want to waste their time.

@Tyriar Tyriar changed the title terminal bug when I enter cls command at windows 10 1903 The cls command doesn't clear the terminal (Windows 10 1903, ConPTY) Apr 30, 2019
@kele1997
Copy link

@Tyriar I get the log,here.
When I run command on cmd,it works fine.(I run three command on cmd, dir,dir,clear
When I run command wsl,toggle to wsl shell,it happens.(I run three commands on bash ls,ls,clear) ,and there are so many Unknown CSI code errors

@Tyriar
Copy link
Member

Tyriar commented May 31, 2019

I found the bug, the terminal isn't flagging lines to be re-rendered again after erasing characters. It's only showing itself when conpty is on because it uses this particular escape sequence (CSI Ps X) to clears out cells.

@starship863
Copy link

I found the bug, the terminal isn't flagging lines to be re-rendered again after erasing characters. It's only showing itself when conpty is on because it uses this particular escape sequence (CSI Ps X) to clears out cells.

Hurrah!

@Tyriar
Copy link
Member

Tyriar commented May 31, 2019

Upstream: xtermjs/xterm.js#2148

@Tyriar Tyriar added this to the June 2019 milestone May 31, 2019
@Tyriar
Copy link
Member

Tyriar commented Jun 4, 2019

Fixed in #74858

@Tyriar Tyriar closed this as completed Jun 4, 2019
@tipleavalentin
Copy link

vscode 1.35 stable and insiders 1.36 - "workbench.action.terminal.clear" command clears the terminal but if you switch and come back to you get the same stuff like before...

@Tyriar
Copy link
Member

Tyriar commented Jun 13, 2019

@tipleavalentin that's a different issue because of how conpty works, see #75141

@Morgy93
Copy link

Morgy93 commented Jun 21, 2019

Still having the exact same issue with 1.35.1 ?!

image

terminal

@tipleavalentin
Copy link

tipleavalentin commented Jun 21, 2019

@Morgy93 same issue I have on 1.35.1. Also 1.36 insider doesn't clear after I switch terminal tabs.

@Tyriar
Copy link
Member

Tyriar commented Jun 26, 2019

@tipleavalentin what do you mean clear after switching terminal tabs? It's not meant to clear then?

@lramos15 lramos15 added the verified Verification succeeded label Jun 26, 2019
@tipleavalentin
Copy link

@Tyriar Here's a video I made: https://youtu.be/HsQ2GS_hbjw

@tipleavalentin
Copy link

The command I run was: workbench.action.terminal.clear

@tipleavalentin
Copy link

The issue is present in the latest insider version, so no fix was done for this. I run Windows 10 x64 1903 18362.175 with git bash 2.22.0.windows.1.

@Tyriar
Copy link
Member

Tyriar commented Jun 26, 2019

@tipleavalentin that's this issue #75141

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label terminal-conpty Integrated terminal issues related to the ConPTY backend verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants