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

Terminal 'Clear' button #239454

Closed
zeru-t opened this issue Feb 3, 2025 · 5 comments
Closed

Terminal 'Clear' button #239454

zeru-t opened this issue Feb 3, 2025 · 5 comments
Assignees
Labels
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

@zeru-t
Copy link

zeru-t commented Feb 3, 2025

Type: Bug

When using the (powershell) terminal's clear button, the next text input will move every character except the first down several lines.

Steps:

  1. Run a command in the powershell terminal that produces an output.
  2. Click the 'Clear Terminal' button to clear all the text from the terminal.
  3. Type any text and the text will be moved down several lines.
Screen.Recording.2025-02-02.232507.mp4

VS Code version: Code 1.96.4 (cd4ee3b, 2025-01-16T00:16:19.038Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 5600X 6-Core Processor (12 x 3700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.93GB (8.23GB free)
Process Argv -n --crash-reporter-id dfa5594f-032d-4774-83bd-dc4f0922a728
Screen Reader no
VM 0%
Extensions (21)
Extension Author (truncated) Version
esbuild-problem-matchers con 0.0.3
vscode-eslint dba 3.0.10
gitlens eam 16.2.1
auto-rename-tag for 0.1.10
shortcut-menu-bar jer 3.0.4
vscode-gutter-preview kis 0.32.2
extension-test-runner ms- 0.0.12
notepadplusplus-keybindings ms- 1.0.7
material-icon-theme PKi 5.19.0
material-product-icons PKi 1.7.1
vscode-thunder-client ran 2.33.2
rust-analyzer rus 0.3.2284
code-spell-checker str 4.0.34
code-spell-checker-scientific-terms str 0.2.5
supermaven Sup 1.1.12
tauri-vscode tau 0.2.9
intellicode-api-usage-examples Vis 0.2.9
vscodeintellicode Vis 1.3.2
markdown-all-in-one yzh 3.6.2
console-logger-z zte 1.1.1
package-annotator zte 1.0.3
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
dwoutputs:31217127
hdaa2157:31222309
copilot_t_ci:31222730

@albertosantini
Copy link

I reproduce the same issue with starship and stock prompt.

Maybe an issue with PSReadLine module. (here pwsh 7.5.0 and PSReadLine 2.3.6)

@albertosantini
Copy link

albertosantini commented Feb 3, 2025

It doesn't happen with (external) Terminal using Ctrl+L or clear command.

@albertosantini
Copy link

Maybe related to PowerShell/PSReadLine#4074?

@zeru-t
Copy link
Author

zeru-t commented Feb 3, 2025

I'm not sure if it relates to that issue...

I'm under the impression the issue comes from VS Code's implementation of the clear functionality because:

  1. All ways of clearing the terminal via VS Code actions cause this issue:
    • Terminal tab bar 'Clear Terminal' button
    • Terminal right-click 'Clear' context menu item
    • Running clear terminal command (workbench.action.terminal.clear)
  2. All other ways of clearing the terminal do not cause this issue:
    • ctrl+L
    • cls
    • clear
  3. This is not reproduceable when running the terminal outside of VS Code.

@meganrogge
Copy link
Contributor

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

@vs-code-engineering vs-code-engineering bot added upstream Issue identified as 'upstream' component related (exists outside of VS Code) terminal-conpty Integrated terminal issues related to the ConPTY backend windows VS Code on Windows issues labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

3 participants