vezel-dev / cathode

A terminal-centric replacement for the .NET console APIs.
https://docs.vezel.dev/cathode
BSD Zero Clause License
91 stars 7 forks source link

Switch to UTF-8 input on Windows #68

Closed alexrp closed 9 months ago

alexrp commented 2 years ago

Get rid of this whole workaround:

https://github.com/vezel-dev/cathode/blob/5f6d532af5848b1572766a345bd33a2c9d5b825b/src/core/Terminals/Windows/WindowsTerminalReader.cs#L50-L129

There should be no functional change; this is just cleanup. Maybe some slight performance gains at best.

alexrp commented 2 years ago

Some context:

alexrp commented 1 year ago

Looks like there is interesting progress happening on this: https://github.com/microsoft/terminal/pull/14745

alexrp commented 9 months ago

Note to self: Need to investigate how well UTF-8 input works on the latest Windows Terminal version. If it mostly Just Works, then we should switch to using it (and it'll be yet another strong argument for #102).

alexrp commented 9 months ago

Need to investigate how well UTF-8 input works on the latest Windows Terminal version.

Quite well, as it turns out! 🏴‍☠️ (4 code points) roundtrips as it should both with UTF-16 input (status quo) and UTF-8 input (with the ReadConsoleW workaround removed).

However, in cmd.exe, it only roundtrips with UTF-16 input. So, this really comes down to #102.