Psreadline: Suggestion : Change default value

Created on 28 Sep 2020  路  5Comments  路  Source: PowerShell/PSReadLine

Hi,

I spent always long minutes to setup powershell for people and i didn't understand why the following options aren't the default one :

Powershell profile example:

Import-Module PSReadLine

Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineOption -predictionsource history (It requiert "PSReadLine 2.1.0-beta2")
Set-PSReadLineOption -HistorySearchCursorMovesToEnd 

(I'm sad to see that predictionsource is just in beta, because it's a primary feature for me)
(i hope it's going soon in release)

Issue-Enhancement Not-Planned

Most helpful comment

@SeeminglyScience - I said I'm open to it because I think many folks just aren't aware that there is a better experience available.

If there is a single completion, then the menu isn't used. Maybe there is a nice compromise where the menu would only be used if there were greater than N completions, say 5 - where tabbing is too tedious. The default binding would work this way, but custom bindings wouldn't change.

All 5 comments

I agree the history defaults should change. I suggest opening a PR.

I don't think we have enough feedback to make inline predictions the default but I suspect it would bother a lot of people.

The default Emacs/Vi Tab experience is vastly superior to the default Windows experience and MenuComplete is different enough that a change would be bothersome to those used to this bash-like experience. I'd only be open to changing the default Windows experience.

The Emacs config in powershell broke tab menu complete :), i didn't use it

MenuComplete may be divisive as a default for Tab on Windows as well due to the extra key press to accept and prompt on many results (e.g. Get<tab>).

@SeeminglyScience - I said I'm open to it because I think many folks just aren't aware that there is a better experience available.

If there is a single completion, then the menu isn't used. Maybe there is a nice compromise where the menu would only be used if there were greater than N completions, say 5 - where tabbing is too tedious. The default binding would work this way, but custom bindings wouldn't change.

I said I'm open to it because I think many folks just aren't aware that there is a better experience available.

Yeah I definitely agree, it comes up in every PSRL reddit thread followed by many astounded replies.

Here's what I'd personally love to see as a default:

  1. Menu always shown on Tab unless there's a single or no result
  2. Don't prompt on high result counts, instead only show the first "page" of results. Maybe with a message suggesting Ctrl + Space to see the rest
  3. Tab or arrow keys (ideally also Ctrl + p/n) to move between items
  4. Enter accepts input like outside of menu. Accepting completion result done with Space (while still adding a space like it does currently)
  5. Esc to clear completion result/menu (like it does currently)

That would fit the existing muscle memory folks have built up while still providing a significant UX boost.

Was this page helpful?
0 / 5 - 0 ratings