From LedHed's Wiki
Revision as of 19:30, 20 November 2020 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

First off I have to say I love you Joseph Napoli, this find changed my life.


One of my biggest complaints about using PowerShell is that Microsoft failed to add some useful command sequences, particularly CTRL+D. If you're a Linux admin you use this key sequence hundreds of times a day. Its by far the easiest way to exit a shell / ssh session.


Enabling EMACS mode in PowerShell

Set-PSReadlineOption -EditMode Emacs

This command enables a user to exit PowerShell with CTRL+D, as well as a few other common key sequences like CTRL+A / CTRL+E (jump to beginning/end of a line).


How to make it persistent

Edit your profile:

echo Set-PSReadlineOption -EditMode Emacs >> $PROFILE


Reference

https://stackoverflow.com/questions/8360215/use-ctrl-d-to-exit-and-ctrl-l-to-cls-in-powershell-console