MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / formatDebugTermOSCLine

Function formatDebugTermOSCLine

cmd/wsh/cmd/wshcmd-debugterm.go:478–495  ·  view source on GitHub ↗
(seq []byte)

Source from the content-addressed store, hash-verified

476}
477
478func formatDebugTermOSCLine(seq []byte) string {
479 // seq is the full sequence starting with ESC ]
480 if len(seq) < 3 {
481 return "OSC " + strconv.QuoteToASCII(string(seq))
482 }
483 // strip ESC ] prefix
484 inner := string(seq[2:])
485 // strip trailing BEL or ST (ESC \)
486 inner = strings.TrimSuffix(inner, "\x07")
487 inner = strings.TrimSuffix(inner, "\x1b\\")
488 // split code from data on first ;
489 if idx := strings.IndexByte(inner, ';'); idx >= 0 {
490 code := inner[:idx]
491 data := inner[idx+1:]
492 return "OSC " + code + " " + strconv.QuoteToASCII(data)
493 }
494 return "OSC " + strconv.QuoteToASCII(inner)
495}
496
497func consumeDebugTermOSC(data []byte, start int) ([]byte, int) {
498 i := start + 2

Callers 1

formatDebugTermDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected