Closed slingamn closed 2 months ago
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: https://github.com/golang/go/issues/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
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
By Microsoft, sorry. Go still supports Windows 7: golang/go#57003
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:https://github.com/chzyer/readline/blob/7f93d88cd5ffa0e805d58d2f9fc3191be15ec668/ansi_windows.go#L164
Thanks very much for your time.