MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / stripANSI

Function stripANSI

tui/status_test.go:111–129  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

109}
110
111func stripANSI(s string) string {
112 var b strings.Builder
113 inEscape := false
114 for i := 0; i < len(s); i++ {
115 ch := s[i]
116 if inEscape {
117 if ch >= '@' && ch <= '~' {
118 inEscape = false
119 }
120 continue
121 }
122 if ch == 0x1b {
123 inEscape = true
124 continue
125 }
126 b.WriteByte(ch)
127 }
128 return b.String()
129}

Calls

no outgoing calls

Tested by

no test coverage detected