Vscode: Terminal "clear" bug

Created on 12 Oct 2017  路  7Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.17.1
  • OS Version: Windows 10

Fix terminal "clear" bug.
Terminal aint cleared, but caret moves to top.

bug integrated-terminal upstream windows

Most helpful comment

I'm using embedded git bash terminal and command "clear" to work with node.js. I have a habbit to clean the log, so I noticed that. I faced that problem after the latest update (1.17.1).
I did run VS code with "--no-extensions" flag. It didn't solve the problem.

screenshots
https://ibb.co/jamrvb
https://ibb.co/noaqow

All 7 comments

How do you try to clear the Terminal? I don't see any button which should have the ability to do this.
The trash icon is to kill the terminal, the x icon to close the terminal and the arrow up to maximize it.

Could you provide more information about it? Are you using a command? If so, on which terminal is that?

How do you try to clear the Terminal? I don't see any button which should have the ability to do this.
The trash icon is to kill the terminal, the x icon to close the terminal and the arrow up to maximize it.

@maxibanki Cmd+K (Or Ctrl+K on Windows)

Can you reproduce it?
In my environment:

  • VSCode Version: Code - Insiders 1.17.0-insider (7ac1f1e05baad03d4dd8f8515f1e598180b2c97e, 2017-09-30T05:06:21.234Z)
  • OS Version: Windows_NT x64 6.1.7601

It works without any problems.

I'm using embedded git bash terminal and command "clear" to work with node.js. I have a habbit to clean the log, so I noticed that. I faced that problem after the latest update (1.17.1).
I did run VS code with "--no-extensions" flag. It didn't solve the problem.

screenshots
https://ibb.co/jamrvb
https://ibb.co/noaqow

There are several related issues:

  • Apparently, using shell-native cls / Clear-Host only clears the _current screen_ (one screen's worth of output), while preserving the rest of the scrollback buffer.

  • By contrast, workbench.action.terminal.clear clears bot the current screen _and_ the scrollback buffer. There is currently no UI element to invoke this command (though the suggestion has been made - see #30077), so a keyboard shortcut is required.

  • Ctrl+K _should_ work on Windows, but apparently doesn't as of 1.18 (even though the UI suggests it should; observed on W7x64); workaround: place the default definition at the end of your keybindings.json file.

  {
    "key": "ctrl+k",
    "command": "workbench.action.terminal.clear",
    "when": "terminalFocus"
  }

Can confirm that adding the default definition for workbench.action.terminal.clear at the end of the keybindings.json file did the trick as per @mklement0's comment. This is on windows 10 running 1.18.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trstringer picture trstringer  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

NikosEfthias picture NikosEfthias  路  3Comments

borekb picture borekb  路  3Comments