This supports checking for the built-in screen readers VoiceOver on
macOS and Windows Narrator, as well as the popular open-source option,
NVDA.
The VoiceOver check spawns a quick `defaults` process since in .NET
using the macOS events is difficult, but this is quick and easy.
The Windows Narrator check inspects a system mutex. Notably though this
screen reader handles re-rendering better than others.
The check for NVDA et. al. inspects the system parameter information.
While this approach is known to be buggy, the preferable and commonly
used algorithm (as implemented by Electron) which checks for loaded
libraries was tested and found to be unsupported for a non-windowed
program like PowerShell.
It's unknown if the SPI check will detect JAWS, Window-Eyes, or
ZoomText, so a command-line option for the upcoming screen reader mode
should also be provided.
Linux is not yet supported.
1. Fix menu completion to work with the predictive list view (fix#1935 -- regression introduced in 2.2.0-beta1)
2. Fix menu completion to clear lines properly when the menu top changes on re-drawing (regression introduced in 2.2.0-beta1)
3. Fix how `RightArrow`, `LeftArrow`, `UpArrow`, and `DownArrow` navigate in the menu view (enhancement)
Upcoming versions of the Windows Console will be able to differentiate
a color set by the Win32 API from a color set by VT. This code
transforms a Win32 color into a VT color, and then uses that VT color
during rendering. When an enlightened console host receives this VT, it
may handle it differently (translate it differently, reverse it
differently, store it differently). Use `39;49` for the default foreground/background.
We'll also teach the various console implementations how to
handle it.
The Windows event log reports a NullReferenceException in
PlatformWindows.OnBreak.
It's unclear what the repro is (perhaps closing the console before it is
fully initialized) but a fix is simple - adding null checks.
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
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
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.
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
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.
Added an input/output argument like IsHandleRedirected. There are four cases for console APIs:
Input is not redirected; input APIs are usable.
Output is not redirected; output APIs are usable.
At least one of input or output is not redirected; things like SetConsoleTitle are usable.
Both streams are redirected; we can't use any console APIs.
It's only used for the first scenario right now, but for completeness, the other cases are also handled.
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.