How to clear the terminal in Visual Studio Code?

 Use Ctrl+K. This goes clean your console in Visual Studio Code.

Per comments, in later versions of VSCode (1.29 and above) this shortcut is missing / needs to be created manually.

  • Navigate: File > Preferences > Keyboard Shortcuts
  • search for workbench.action.terminal.clear
  • If it has no mapping or you wish to change the mapping, continue; otherwise note & use the existing mapping
  • Double click on this entry & you'll be prompted for a key binding. Hold CTRL and tap KCtrl + K should now be listed. Press enter to save this mapping
  • Right click the entry and select Change when expression. Type terminalFocus then press enter.
  • That's it. Now, when the terminal is in focus and you press Ctrl+K you'll get the behaviour you'd have expected to get from running clear/cls.
Mudasir Abbas Turi

Hi, this is Mudasir Abbas Turi. I am a Full-stack PHP and JavaScript developer with extensive experience in building and maintaining web applications. Skilled in both front-end and back-end development, with a strong background in PHP and JavaScript. Proficient in modern web development frameworks such as Laravel and ReactJS. Proven ability to develop and implement highly interactive user interfaces, and to integrate with various APIs and databases. Strong problem-solving skills and ability to work independently and as part of a team. Passionate about staying up-to-date with the latest technologies and industry trends.

Post a Comment

Previous Post Next Post