(sequence: string)
| 33 | * wrapped \x07 is opaque DCS payload and tmux never sees the bell. |
| 34 | */ |
| 35 | export function wrapForMultiplexer(sequence: string): string { |
| 36 | if (process.env['TMUX']) { |
| 37 | const escaped = sequence.replaceAll('\x1b', '\x1b\x1b') |
| 38 | return `\x1bPtmux;${escaped}\x1b\\` |
| 39 | } |
| 40 | if (process.env['STY']) { |
| 41 | return `\x1bP${sequence}\x1b\\` |
| 42 | } |
| 43 | return sequence |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Which path setClipboard() will take, based on env state. Synchronous so |
no outgoing calls
no test coverage detected