EscHelpers
Value members
Concrete methods
Returns true if the string contains the ESC character.
Returns true if the string contains the ESC character.
TODO - this should handle raw CSI (not used much)
Returns the string s
with escape sequences removed. An escape sequence starts with the ESC
character (decimal value 27) and ends with an escape terminator.
Returns the string s
with escape sequences removed. An escape sequence starts with the ESC
character (decimal value 27) and ends with an escape terminator.
- See also:
isEscapeTerminator
Strips ansi escape and color codes from an input string.
Strips ansi escape and color codes from an input string.
- Value parameters:
- bytes
the input bytes
- stripAnsi
toggles whether or not to remove general ansi escape codes
- stripColor
toggles whether or not to remove ansi color codes
- Returns:
a string with the escape and color codes removed depending on the input parameter along with the length of the output string (which may be smaller than the returned array)
Removes the ansi escape sequences from a string and makes a best attempt at calculating any
ansi moves by hand. For example, if the string contains a backspace character followed by a
character, the output string would replace the character preceding the backspaces with the
character proceding it. This is in contrast to strip
which just removes all ansi codes
entirely.
Removes the ansi escape sequences from a string and makes a best attempt at calculating any
ansi moves by hand. For example, if the string contains a backspace character followed by a
character, the output string would replace the character preceding the backspaces with the
character proceding it. This is in contrast to strip
which just removes all ansi codes
entirely.
- Value parameters:
- s
the input string
- Returns:
a string containing the original characters of the input stream with the ansi escape codes removed.