'Visual Studio Code - Where is the terminal history saved?
I noticed that the command history is saved when using Visual Studio Code. Using the arrow up and down keys, I can toggle through previously issued commands in the integrated terminal.
Where is the terminal history saved on the drive? Is it possible to open a file in notepad (or notepad++) and investigate the complete history, delete it?
I'm using Windows 10, and I have concluded that deleting the folders C:\Users\john\.vscode and C:\Users\john\AppData\Roaming\Code will not delete the terminal history for a particular project.
Solution 1:[1]
On Ubuntu you can see your history using this command:
vi ~/.bash_history
Solution 2:[2]
On Linux & MacOS, type the following command to display the path of the history file:
echo $HISTFILE
The history file may be different between VSCode and your regular terminal. So you should type this command within the integrated terminal.
Solution 3:[3]
In vscode v1.65 Insiders there is this new command:
workbench.action.terminal.clearCommandHistory : "Clear Command History"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | aboger |
| Solution 2 | Zitoun |
| Solution 3 | Mark |
