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.
When the prompt is drawn with a different color than the default text,
after displaying the error prompt, the prompt is not restored correctly.
The option -PromptText will now recognize the use of escape sequences
for color so the prompt can be restored correctly after the error prompt
is removed.
The output encoding is set for CJK characters, so if that fails, it
would be nice to know, but it comes up often (redirected input,
legacy conhost) so we just ignore the exception.
I missed `Console.TreatControlCAsInput` when refactoring the port from
PowerShell/PowerShell - this isn't needed on Windows because it was
handled more directly via SetConsoleMode.
Fix#610
Introduced a very minimal terminal emulator, enough to support the
colors used by default (ConsoleColor).
There could be some more error checking or just somehow ignoring unknown
escapes, but we'll see if this is sufficient for now.
Fix#596
Windows PowerShell on Win10 before Fall Creators update would fail to
keep ENABLE_VIRTUAL_TERMINAL_PROCESSING set after running other
executables.
This change ensures that it is always.
The change can be removed when Fall Creators Update or later is
required.
Fix#582
To make it a bit easier to create themes, the various parameters to
Set-PSReadLineOption to set colors has been replaced with a single
parameter accepting a Hashtable.
The valid keys are:
-- ContinuationPrompt: The color of the continuation prompt.
-- Emphasis: The emphasis color, e.g. the matching text when searching history.
-- Error: The error color, e.g. in the prompt.
-- Default: The default token color.
-- Comment: The comment token color.
-- Keyword: The keyword token color.
-- String: The string token color.
-- Operator: The operator token color.
-- Variable: The variable token color.
-- Command: The command token color.
-- Parameter: The parameter token color.
-- Type: The type token color.
-- Number: The number token color.
-- Member: The member name token color.
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