1

I was messing around in python and ran a few programs from terminal and noticed that using the up arrow you could backtrack to previously ran program. I thought this was a nice feature but I'm wondering where and which file I have to edit to delete past commands?

Note: Restarting VS Code doesn't remove these commands from terminal history

DAda
  • 947
  • 1
  • 5
  • 6
  • This is most likely OS specific. And if you're using a non-default shell, also specific to that shell. – HolyBlackCat Oct 25 '20 at 15:59
  • Windows 10, everything default – DAda Oct 25 '20 at 15:59
  • Does it print `PS C:\whatever>` when asking you for a command, or just `C:\whatever>`? – HolyBlackCat Oct 25 '20 at 16:06
  • It includes PS C:\whatever – DAda Oct 25 '20 at 16:12
  • If you are using Powershell, the default, try this command `(Get-PSReadlineOption).HistorySavePath` for the location of the command history file. For bash `echo $HISTFILE`. See https://www.shellhacks.com/clear-history-powershell/ for more. – Mark Oct 25 '20 at 16:16
  • `PS` means you're using powershell, so google something like `powershell clear history`. Or follow advice from the above comment. – HolyBlackCat Oct 25 '20 at 16:20
  • Now probably a duplicate of https://stackoverflow.com/a/71165251/836330 as there is a new command in vscode v1.65 to clear the terminal command history. – Mark Feb 17 '22 at 21:10

0 Answers0