(text: string)
| 214 | } |
| 215 | |
| 216 | function tryCopyViaOsc52(text: string): boolean { |
| 217 | const sequence = buildOsc52Sequence(text) |
| 218 | if (!sequence) return false |
| 219 | |
| 220 | const ttyPath = process.platform === 'win32' ? 'CON' : '/dev/tty' |
| 221 | let fd: number | null = null |
| 222 | try { |
| 223 | fd = openSync(ttyPath, 'w') |
| 224 | writeSync(fd, sequence) |
| 225 | return true |
| 226 | } catch { |
| 227 | return false |
| 228 | } finally { |
| 229 | if (fd !== null) closeSync(fd) |
| 230 | } |
| 231 | } |
no test coverage detected