visual-studio-codeterminalcommand-line-interface

How to enable the history of the terminal in VS Code


I don't know how I enabled this feature before, but I found it incredibly useful for someone who primarily works in the terminal.

It displays the history of commands based on my inputs, allowing me to select them quickly. Now, I have no way to enable this table again... I've already searched on Google for this feature, but I don't see anyone mentioning it...

enter image description here


Solution

  • The screenshot looks like Oh My Posh with PSReadLine installed. You can configure the history and autocompletion in your PowerShell profile (type $profile to show the path, or directly open it with code $profile if you have e.g. VSCode in your $PATH):

    Import-Module PSReadLine
    Set-PSReadLineOption -PredictionSource History
    Set-PSReadLineOption -PredictionViewStyle ListView