1. Preserve the saved current line and the history index while in a series of history commands.
So when switching between different history command, such as from `F8`/`Shift+F8` (`HistorySearchBackward` and `HistorySearchForward`) to `UpArrow`/`DownArrow` (recall history) or from `Ctrl+r`/`Ctrl+s` to `UpArrow`/`DownArrow`, the history command can continue to work as expected.
2. Clear the saved current line when we are out of a series of history commands.
So the saved line will not leak to another unrelated history search.
There are likely issues introduced by this PR,
but I'm merging for a new Beta so this code gets more testing.
* Introduce PSKeyInfo type alias
* Explicit conversions b/w ConsoleKeyInfo and PSKeyInfo
* Change tests to use actual ConsoleKeyInfo data
* Add fr-FR keyboard layout tests
* Add KeyInfo-ru-RU-windows.json (#839)
All impossible without Shift shortcuts labeled as "Investigate: true"
Alt+Spacebar tracked by windows itself
* Add KeyInfo for Polish (Programmers) layout on Windows and Linux (#870)
On Windows *Alt+Spacebar* is hijacked by Windows
On Linux any *Alt+F1-12* combination was not detected
I was terribly inconsistent.
This is a breaking change, though unlikely to cause troubles.
The apis are mostly used in PowerShell scripts which is not
case sensitive.
The cmdlet name change is also mostly safe.
At any rate, this is version 2.0 and breaking changes should be OK.
A fix for vi mode broke placing the cursor after recalling commands from
history.
There was also a small inconcistency in placing the cursor in vi mode
when in command mode.
Fix#592
Rewrote the custom key binding code to be more portable.
Some runtime checks are necessary because of impossible to reconcile
differences.
Some Win32 P/Invoke calls are still needed due to lack of information in
the ConsoleKeyInfo.
Some keys are currently not available on Linux due to a CLR bug, others
aren't available ever because terminals don't unique character sequences
for a given key press that might differ in just the Shift or Ctrl state.
Fix selection to use escape sequence for invert - it doesn't look that
great when there are too many colors, but it will work with any
customization.
Also fix tests to work after previous commit.
If there was a single abandoned mutex, and the history file is read
sucessfully after the abandoned mutex, we would enter an inifite loop
reading the history file until we got a couple more abandoned mutexes.
Fixes#524
When there is an IO error trying to create the directory for the history file, or some other sort of error trying to read or write the history file, we shouldn't tell the user to report a bug.
Instead, the error will just report the exception message, and if it happens twice, suggest some solutions.
The error will not be reported more than twice, because that would be too annoying.
Fixes#322
When using UpArrow, people prefer not recalling commands
from other currently running sessions.
It's still useful to avoid entering commands that have
might have been entered in another currently running session,
so those commands can still be found when *searching*
history, either interactively, or if the search string
is not empty when using HistorySearch[Backward|Forward].
Also fixed in this change - an obscure bug where
HistoryNoDuplicates did not work well with a DigitArgument
when recalling history.
Fixes#179
The "current" line cleared after accepting via AcceptAndGetNext
and we would crash trying to recall this current line.
I've changed how history search works after AcceptAndGetNext
to work in a more natural way so that arrow keys can be used
to recall commands near the accepted command instead of
searching for other commands with the same prefix.
Fixes#152.
To avoid cluttering the screen and history with command lines
that don't work because of stupid errors like "command not found",
you can bind enter to ValidateAndAcceptLine.