RemoveEscapeCodes removes both OSC 8 hyperlinks and ANSI color codes from a string. This should be used when calculating the visible width of a string for rendering.
(s string)
| 25 | // RemoveEscapeCodes removes both OSC 8 hyperlinks and ANSI color codes from a string. |
| 26 | // This should be used when calculating the visible width of a string for rendering. |
| 27 | func RemoveEscapeCodes(s string) string { |
| 28 | // Strip OSC 8 hyperlinks first, then color codes |
| 29 | s = StripOSC8Hyperlinks(s) |
| 30 | return color.ClearCode(s) |
| 31 | } |
no test coverage detected
searching dependent graphs…