- Update `ReallyRender` to avoid writing everything every time when editing the text. Instead, we find the first different logical line, and starting writing from there.
- Refactor `ReallyRender` by moving some logic to separate methods.
- Support editing text even if the top of the text has been scrolled up-off the buffer.
- Disallow cursor to be set to a position that is off the buffer.
- Fix a bug in `ConvertLineAndColumnToOffset` so that a point can be translated to the offset correctly.
- Prevent adjustment of `userCompletionText` in `FindUserCompletionTextPosition` when the match contains `{` in CompletionText[1] if the `userCompletionText` is not longer than 1 char
- Preserve the splat sigil at start of completions of type `Variable`.
Adjusting `userCompletionText` blindly led to `ArgumentOutOfRangeException` on incorrectly braced splats on input `@?`.
Loss of the sigil of splats led to the splat sigil always being marked as replaced, and in situations where the PowerShell completion logic returned incorrect completions of splats with braces, led to a `ArgumentOutOfRangeException`.
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
The original fix in #771 resulted in essentially never setting the UTF8
output encoding because it only tested the fixed width bit on the font
family, but every console font is fixed width.
The proper fix appears to be testing that all 4 lower bits in FontFamily
are not set.
Fix#823
The method Keys.ShouldInsert was a misguided attempt to avoid inserting
keys where there is no binding but the key really doesn't make sense as
input.
Unfortunately it is just causing more pain and probably wasn't
addressing a serious problem, so I'm removing it.
Fix#798
For Mac/Linux, if the commands to use the system clipboard are missing,
we can at least simulate a clipboard internally, just for PSReadLine.
This is allows the clipboard tests to run in the Azure DevOps CI for
Linux.
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
VkKeyScan returns -1 when there is no key mapping for the given
character.
This possiblity was not considered, resulting in an attempt to add
duplicate (but invalid) keys to the CtrlKeyToKeyMap.
Fixes#787
LanguagePrimitives.TryConvertTo raises (and catches) exceptions on
failed convertions to an enum type like ConsoleColor.
These exceptions were affecting debugging performance of the menu and we
never want exceptions if it's easy to avoid, which in this case it is.
A recent PR disabled the display of tooltips, and there were
some problems with the menu display when the command line
was at the bottom of the buffer and scrolling was necessary.
Fix#763 and probably #765
conhost (Windows only) could change the font unexpectedly if the current font is a raster font and the code page changes to UTF8.
PSReadLine was switching to UTF8 output encoding to address some display issues with CJK,
This change skips the UTF8 output encoding change if it would cause conhost to change the font.
If the console buffer is small, we sometimes tried to move the cursor outside the buffer when displaying possible completions or the completion menu.
The fix:
* avoids displaying the tooltip if it doesn't fit in the buffer
* places the cursor without scrolling when simply printing the completions (no menu selection)
Write-Progress or some other UI might scroll the screen while computing completions and that needs to be detected to properly render after fetching the completions.