Replies: 3 comments 11 replies
-
@alabuzhev @eryksun @KalleOlaviNiemitalo @malxau @Maximus5 |
Beta Was this translation helpful? Give feedback.
-
@lhecker, thanks for the notice. Our usage of ReadConsoleOutput is described here: #10810 (comment)
Do I understand correctly that "leading" and "trailing" here refer to duplicates with
Do I understand correctly that this is about the case when the app was supposed to write If so, no concerns from my side. |
Beta Was this translation helpful? Give feedback.
-
Re PowerShell saving and restoring console characters behind a progress bar. How does it work if an application has previously output wide characters, and the rectangle that PowerShell saves, overwrites and restores, contains parts of those wide characters? For example:
|
Beta Was this translation helpful? Give feedback.
-
We're considering to introduce breaking changes to the console APIs in #13321 and I'd love to hear everyone's opinion about these!
Minor breaking changes
ReadConsoleOutputA
will now always zero the high byte in(CHAR_INFO).Char.UnicodeChar
. Only the.AsciiChar
can be used then. This prevents users from storing "additional" data in the terminal buffer.ReadConsoleOutputA
will now zero the.AsciiChar
if it fails to convert the Unicode character into an appropriate DBCS.WriteConsoleOutputA
will now return0x00
instead of0x44
(the lower half of い's code point0x3044
).Major breaking changes
ReadConsoleOutputW
will now repeat the leading Unicode character twice and ignore the trailing one.0x3044 0xabcd
withWriteConsoleOutputW
used to yield the same0x3044 0xabcd
if read back withReadConsoleOutputW
. This worked because conhost effectively ignored the trailing codepoint, allowing one to "smuggle" data. In the future this trailing character will be discarded and produce0x3044 0x3044
instead.WriteConsoleOutputA
can be done with code page 932 (Shift-JIS) and the DBCS0x82 0xa2
. If read back withReadConsoleOutputW
this would previously yield the two Unicode characters0x3044 0xffff
. After this commit it'll yield0x3044 0x3044
.The goal of these changes is a migration of the strictly column/grid oriented text buffer over to one that stores text the way it would be stored in a text file (i.e. without code point duplications, #8000). An experimental branch can now store arbitrarily complex characters in arbitrarily many columns, which allows us to support complex Emojis with zero width joiners in a single wide column for instance.
While it's possible to keep the existing behavior, it would require us to introduce "legacy behavior" checks in every single function that touches the text buffer, which is a maintenance burden that is hard to justify. We believe that it's unlikely that these changes will break existing software in any significant way and thus opted for a breaking change.
Beta Was this translation helpful? Give feedback.
All reactions