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
Special control characters such as ANSI escape codes are included in calculation of row length (which is determined by string length). This results in table rows appearing larger than they should be.
Example:
This is used for the row (outlined); the ANSI escape sequence is red
This results in the following output:
(The affected row is red)
This is because the length of the ANSI escape characters in the example is 7, which results in 7 additional characters in the row cell:
Possible Solution
A possible solution would be using regex to filter such characters and escape sequences from the row content string, and using the resulting string length to determine the row length.
The text was updated successfully, but these errors were encountered:
Decimation
changed the title
Suggestion: Ignore special control characters / virtual terminal sequences
Suggestion: Ignore special control characters / virtual terminal sequences in row length calculation
May 6, 2022
The issue makes ugly the to colorize output, because color characters in console are calculated as table width.
For example showing negative numbers in RED
.WithFormatter(4, text =>{if(Int32.Parse(text.ToString())<0){returntext.ToString().Pastel(Color.Red);}returntext.ToString();})
Description
Special control characters such as ANSI escape codes are included in calculation of row length (which is determined by string length). This results in table rows appearing larger than they should be.
Example:
This is used for the row (outlined); the ANSI escape sequence is red
This results in the following output:
(The affected row is red)
This is because the length of the ANSI escape characters in the example is
7
, which results in7
additional characters in the row cell:Possible Solution
A possible solution would be using regex to filter such characters and escape sequences from the row content string, and using the resulting string length to determine the row length.
See Console virtual terminal sequences
The text was updated successfully, but these errors were encountered: