* Check if OSC sequence is complete * OSC sequences: ESC ] ... ST (where ST is ESC \ or BEL)
(data: string)
| 130 | * OSC sequences: ESC ] ... ST (where ST is ESC \ or BEL) |
| 131 | */ |
| 132 | function isCompleteOscSequence(data: string): "complete" | "incomplete" { |
| 133 | if (!data.startsWith(`${ESC}]`)) { |
| 134 | return "complete"; |
| 135 | } |
| 136 | |
| 137 | // OSC sequences end with ST (ESC \) or BEL (\x07) |
| 138 | if (data.endsWith(`${ESC}\\`) || data.endsWith("\x07")) { |
| 139 | return "complete"; |
| 140 | } |
| 141 | |
| 142 | return "incomplete"; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Check if DCS (Device Control String) sequence is complete |
no outgoing calls
no test coverage detected