- Reduce code duplication by reusing GetBeginningOfLinePos in InsertLineAbove.
- Correct newline search in GetBeginningOfLinePos (HOME) and InsertLineAbove to not ignore first character in the buffer which
might be a new line.
- Manifests as cursor jumps to line 1, because line 1 is blank, when triggered with cursor anywhere on line 2.
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
This fixes some weird issues in WSL and some Linux terminals.
This also works around a Windows 1809 Console bug for the Ctrl+l binding
to clear the screen by using the same escape sequence that bash uses.
Fix#724
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.
To get the unit tests passing in VS2015, and to help w/ possible future hosts,
I've moved most of the console api usage to a class, which is then mocked
in the unit tests.
This problem only happened in ValidateAndAcceptLine
It also only happened if validation failed for any reason.
The fix is to insert a newline even if validation failed if we still have pending input.
If there is no pending input, we don't want to insert the newline, as this is the common
case and people will not want to delete the blank line from the inserted newline.
There was an exception with input like:
a Alt+1 Ctrl+C
CancelLine was clearing the buffer, but didn't reset _current.
That fixes the exception, but it still clears the input line
when called to terminate DigitArgument, so instead we do something
similar to how interactive history search is terminated.
Fixes#184
Script block arguments are now only validated as arguments to specific
cmdlets (which are in a user modifiable whitelist.)
A custom validation handler must now throw an exception to report an error,
returning an object is now ignored.
A sample custom validation handler was added to demonstrate typo correction.
Fixes#162