Use CTRL + D to exit and CTRL + L to cls in Powershell console

前端 未结 6 1526
说谎
说谎 2021-02-01 13:13

I am trying to make

CTRL + D - exit Powershell console

and

CTRL + L - clear the screen

like in bash.

6条回答
  •  借酒劲吻你
    2021-02-01 13:35

    The keybindings are controlled by PSReadLine. PSReadLine's default edit mode is Windows style, where Ctrl-D is unbound.

    Set your edit mode to Emacs

    Set-PSReadlineOption -EditMode Emacs
    

    or bound the key

    Set-PSReadLineKeyHandler -Key 'Ctrl+d' -Function DeleteCharOrExit
    

提交回复
热议问题