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

前端 未结 6 1524
说谎
说谎 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:39

    You can set your PSReadline to emacs mode, it will not only exit with ^D, you will be able to go to beginning of line with ^A, end of the line with ^E

    Include this in your profile: Set-PSReadlineOption -EditMode Emacs

    I'm using cmder which uses ConEmu, find profile.ps1 with /vendor/ for that case and you can add into that file.

    Otherwise you can add to default locations where powershell loads it. One of tutorials HERE.

提交回复
热议问题