EscHelpers

sbt.internal.util.EscHelpers$
object EscHelpers

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def cursorPosition(s: String): Int
def hasEscapeSequence(s: String): Boolean

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)

Attributes

def removeEscapeSequences(s: String): String

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.

Attributes

See also:

isEscapeTerminator

def strip(bytes: Array[Byte], stripAnsi: Boolean, stripColor: Boolean): (Array[Byte], Int)

Strips ansi escape and color codes from an input string.

Strips ansi escape and color codes from an input string.

Attributes

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)

def stripColorsAndMoves(s: String): String

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.

Attributes

s

the input string

Returns:

a string containing the original characters of the input stream with the ansi escape codes removed.

Deprecated methods

def stripMoves(s: String): String

Attributes

Deprecated
true

Concrete fields

final val ESC: '\u001b'

Escape character, used to introduce an escape sequence.

Escape character, used to introduce an escape sequence.

Attributes