You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that text/tabwriter, which is used for visually aligning text, doesn't seem to account for things being invisible.
There was an abandoned attempt to fix part of this (the ANSI escape codes) here, but I can't see an attempt to revisit it.
Here's a small program that illustrates the problem. This seems insensitive to the flags passed to NewWriter. Note that both the line with NUL bytes and the line with ANSI escape codes are misaligned.
StripEscape only strips the tabwriter-defined escape character, 0xff. It does not strip general unprintable characters.
In any case, text/tabwriter is effectively frozen. I'm going to close this, as I don't think we're going to accept improvements at the moment.
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:This shouldn't be relevant, but I've included it below.
go env
What did you do?
I noticed that text/tabwriter, which is used for visually aligning text, doesn't seem to account for things being invisible.
There was an abandoned attempt to fix part of this (the ANSI escape codes) here, but I can't see an attempt to revisit it.
Here's a small program that illustrates the problem. This seems insensitive to the flags passed to NewWriter. Note that both the line with NUL bytes and the line with ANSI escape codes are misaligned.
What did you see happen?
A misaligned table was printed. A screenshot follows.
What did you expect to see?
I expected an aligned table to be printed.
The text was updated successfully, but these errors were encountered: