Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to remap the shortcut in powershell, for example, I'd like to use Ctrl + a to make cursor at beginning of line, Ctrl + e to make cursor at the end of line, etc.

I searched the method in Google for long time, but it seems no one did that before. Any one can help? Thanks in advance.

share|improve this question
up vote 0 down vote accepted

Do you talk about powershell.exe console?
You can define it with PSConsoleHostReadLine function with PowerShell "3.0"

see here. http://www.leeholmes.com/blog/2012/09/13/bash-like-tab-completion-in-powershell/

share|improve this answer
2  
Please provide more details on how to use the PSConsoleHostReadLine function. Not everyone is a PowerShell expert. – Karan May 28 '13 at 23:14
    
Excuse me Microsoft PowerShell team don't try to make the document, you should request it to them, not to me... – hoge May 29 '13 at 3:15
1  
@hoge sorry if you misunderstood. On Super User we prefer answers to give sufficient information to solve the problem (or at least get a good start) without having to go hunting for further resources. If you need to link to another site (or just provide the name of a function), we would prefer that you add some information summarizing how to do it. As a question and answer site, we're focused on providing complete answers, not just serving as a link portal to other sites. This is partially because links often die over time, and we also like to give a full answer. Thanks, and welcome! – nhinkle May 29 '13 at 4:59
    
@hoge Version of my powershell is 3.0, I will have some investigation about PSConsoleHostReadLine which you mentiond. Thank you. – Marslo May 29 '13 at 6:11
    
Well, the PSReadline module pretty cool!! But, there some bugs in there, so I cannot use this module because of specific prompt. But it works!! Thanks @hoge – Marslo May 29 '13 at 7:38

There are now 2 versions of PSReadline. The original version (referred to in the accepted answer) is not maintained and does have some bugs.

A more fully featured and actively maintained version is described here:

http://rkeithhill.wordpress.com/2013/10/18/psreadline-a-better-line-editing-experience-for-the-powershell-console/

share|improve this answer
    
Thanks! Actually, I've re-map the shortcut by AutoHotKey. I will try. – Marslo Oct 24 '13 at 9:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .