MCPcopy Create free account
hub / github.com/gokcehan/lf / parseEscapeSequence

Function parseEscapeSequence

termseq.go:107–113  ·  view source on GitHub ↗

parseEscapeSequence takes an escape sequence option (e.g. `\033[1m`) and converts it to a [tcell.Style] object. Legacy function that only accepts SGR. Kept for convenience.

(s string)

Source from the content-addressed store, hash-verified

105// converts it to a [tcell.Style] object.
106// Legacy function that only accepts SGR. Kept for convenience.
107func parseEscapeSequence(s string) tcell.Style {
108 s = strings.TrimPrefix(s, "\033[")
109 if i := strings.IndexByte(s, 'm'); i >= 0 {
110 s = s[:i]
111 }
112 return applySGR(s, tcell.StyleDefault)
113}
114
115// applyTermSequence takes an escape sequence (e.g. `\033[1m`) and applies it
116// to the given [tcell.Style] object.

Callers 4

TestParseEscapeSequenceFunction · 0.85
printDirMethod · 0.85
drawBoxMethod · 0.85
drawMenuMethod · 0.85

Calls 1

applySGRFunction · 0.85

Tested by 1

TestParseEscapeSequenceFunction · 0.68