Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. xthexder revised this gist Dec 19, 2021. 1 changed file with 6 additions and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,9 @@ Import-Module posh-git
    Set-PSReadLineOption -HistoryNoDuplicates:$True

    Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
    Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
    Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

    # Revert posh-git prompt to default
    function prompt {
    'PS ' + $(Get-Location) + $(if ($nestedpromptlevel -ge 1) { '>>' }) + '> '
    }
  2. xthexder created this gist Dec 19, 2021.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Import-Module PSReadLine
    Import-Module posh-git

    Set-PSReadLineOption -HistoryNoDuplicates:$True

    Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
    Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward