-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove Windows output translation #218
Conversation
Nice cleanup 👍 by "all supported versions of windows" you mean all version of windows supported by microsoft or golang? |
By Microsoft, sorry. Go still supports Windows 7: golang/go#57003 |
I see, thanks! some users of https://github.com/wader/fq seem to have some ANSI related issues on windows, for example underline with colored text somehow ends up changing the background color. I don't know much about windows or windows terminal so i'm bit lost :) |
btw fq uses this readline fork https://github.com/wader/readline that has a bunch of fixes, maybe interesting |
This is now supported natively via ENABLE_VIRTUAL_TERMINAL_INPUT.
Did some testing with fq with these changes, seems to work fine. Do you know if ANSI colors are natively support in the "old" cmd.exe also? i tested using virtualbox and image from https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ |
Yep, I tested with Windows 10 22H2 on metal in both PowerShell and cmd.exe. Both aspects of this patch (ANSI output rendering and input processing) are fully functional in both contexts. FWIW I'm still working on contacting chzyer and putting together a fork. |
@slingamn Great 👍 let us know how it goes |
No, it end support |
@NCLnclNCL technically it is still supported as long as Go 1.20 is supported, i.e. until Go 1.22 is released :-) |
This is merged and in the stable release of https://github.com/ergochat/readline , closing the PR here |
According to https://github.com/jwalton/go-supportscolor the technique here is valid on all supported versions of Windows.
Without this change, 256-color ANSI codes will panic. For example,
48;
sets a background color from the 256-color palette and causes an out-of-bounds read here:readline/ansi_windows.go
Line 164 in 7f93d88
Thanks very much for your time.