Fix terminal "clear" bug.
Terminal aint cleared, but caret moves to top.
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:
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.
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