I am coding on an M2 Macbook Air, and when right clicking on the termial in VS Code, I see 2 commands: kill terminal
and clear
. What is the difference between both? They seem fairly similar.
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
3
Answers
I was able to fix the issue. It must have been a bug on my end.
Killing the terminal stops whatever is running from running and shuts down the terminal; clearing the terminal removes previous commands to "tidy up" the appearance, but keeps the terminal open.
… one clears it ("clears the screen" without closing the session- more of a visual aesthetic thing to visually declutter). Somewhat related but not 100% related: the UNIX
clear
command, and readline’sclear-display
binding.and one kills it (terminates the shell session). Somewhat related but not 100% related: the
logout
command and readline’send-of-file
binding (since it’s often configured to close upon the end-of-file character (see alsostty eof
)), bash’sexit
builtin command.Also note that if you want to do these actions via VS Code’s command palette, you can use
Terminal: Clear
andTerminal: Kill the Active Terminal Instance
or the otherTerminal: Kill ...
commands.