Like any other modern code editor, the VS Code has an integrated terminal that is generally used to showcase the output of a code.
But how are you supposed to clear the terminal?
Well, the easiest (tested on Windows and Linux) is to hover the cursor over the terminal and use the Ctrl + l
to clear the terminal.
Alternatively, you can use the Ctrl + ` to get into the terminal window:
That works but takes a bit longer. What if you want to use any other shortcut? In this tutorial, I will show you how to do that.
Clear the terminal in VS Code
Here, I will walk you through step by step how you can allocate a specific shortcut to clear the terminal in VS Code.
First, press Ctrl + Shift + p
and it will bring you the command editor:
Here, you will have to search for clear command for the terminal by typing the following in the command editor:
Terminal: Clear
And click on the little gear icon for the first result:
Here, click on the plus +
icon and it will ask you to create a shortcut to clear the terminal. You may use various options, but in case, I went with Ctlr + Alt + l
as it was not occupied by any other operation:
Once done, press the Enter
key to confirm the shortcut and that's it!
From now on, you don't have to switch to the terminal window to clear the terminal:
Pretty cool. Isn't it?
Looking for more VS Code shortcuts?
Shortcuts give you a superpower. Mastering correct shortcuts makes you more efficient and helps you become more productive.
Here are a list of best VS Code shortcuts you should know and master.
By the way, have you heard of VSCodium, a complete open source version of VS Code?
I hope you will find this helpful. And if you have any queries, feel free to ask in the comments.