(seq []byte)
| 476 | } |
| 477 | |
| 478 | func 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 | |
| 497 | func consumeDebugTermOSC(data []byte, start int) ([]byte, int) { |
| 498 | i := start + 2 |
no outgoing calls
no test coverage detected