PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.77k stars 298 forks source link

Suggestion: Beep when hitting beginning/end of history search #107

Open favorini opened 10 years ago

favorini commented 10 years ago

When you are searching the history and there are no more entries, a beep would be helpful to distinguish between the end/beginning of the history (or matching items) and just a bunch of duplicates.

Another possibility would be to show some progress indicator below the current line, even when not doing Reverse/ForwardSearchHistory. Something like:

PS T:\> 'hello, world!'
bck-i-search [1/500]: hello_
PS T:\> 'hello<UpArrow>, world!'
[1/500]

if you have 500 history entries and the first one is 'hello, world!'

lzybkr commented 10 years ago

The progress indicator is an interesting idea, I might try that.

favorini commented 10 years ago

One thing that occurs to me is that it would be nice to see the history ID number that works with Invoke-History also, since it could be different from the ordinal place in the current history if you have run more commands than $MaximumHistoryCount. This could change the indicator to

[42:1/4096]

which refers to the 42nd command run in the current session, which is first out of the 4096 commands saved in the history (maxed out). You could omit this when session history hasn't yet exceeded $MaximumHistoryCount.

[16/143]

which refers to the 16th command run in the current session, which is 16th out of the 143 commands saved in the history (not maxed out).