Open
Description
Environment data
PSReadline version: 2.0.0-beta3
Windows
This applies to all extant versions of Powershell.
Steps to reproduce or exception report
There are a number of user preferences that are PSReadline stores and restores across command executions; it is arguable as to whether it is PSReadline's job to do so.
- the codepage
- this is the cause of font flickering across commands in the windows console (still!)
- mitigation: none; i'm curious as to why it changes the codepage to begin with?
- the index of the currently-set foreground and background colors
- when using a modern terminal (or the terminal options in Windows 19H1), this causes colored lines to streak across the window because the "default colors" are not representable through color indices.
- mitigation:
CSI 0 m
will reset the color to whatever the user requested as defaults
[ ] the height of the legacy cursor (Bug Report: Cursor Shape setting is not persistent and reverts to legacy style microsoft/terminal#1145)<update: this is not a PSReadLine issue, see Cursor shape gets reverted to legacy style after hiding the cursor and then making it visible again in console window microsoft/terminal#4124>mitigation: use the standard VT sequences for cursor shaping
- the cursor position, in some limited cases.
- it would be better to (and this is probably a breaking change) conform to the *NIX model where you're not easily allowed to know where the cursor is
Most of these things happen here.
PSReadLine/PSReadLine/ReadLine.cs
Lines 436 to 452 in f2f5531