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.
Correct cursor positioning in cases where newline appears 1 character before
last column, or a CJK character ends the line but wraps to next display
line, and in cases where continuation prompt contains either CJK characters,
or VT color sequences.
Fixes#1216, #1217, #1188.
- 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.
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
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.
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.