I'm happily running Git bash in VSCode 1.53.2 on Windows 10 with:
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
The "Terminal: Clear" command (workbench.action.terminal.clear
, which I have bound to Control-L) clears not only the screen but also the scrollback buffer, as expected, so trying to scroll up does nothing because there is nothing to show.
How can I reproduce this with a shell command?
The clear
command does not clear the scrollback, neither does reset
. These commands work by outputting escape sequences to the screen. Since the terminal thinks it is "TERM = xterm-256color", the relevant escape sequence should be the one output by the shell command
printf "\e[3J"
which works on all other xterm emulations (and is part of clear
's output). In VSCode it does not clear the scrollback but, oddly, resurrects one screenful of previously cleared scrollback.