(text: string)
| 88 | * Returns true if the buffer was loaded successfully. |
| 89 | */ |
| 90 | export async function tmuxLoadBuffer(text: string): Promise<boolean> { |
| 91 | if (!process.env['TMUX']) return false |
| 92 | const args = |
| 93 | process.env['LC_TERMINAL'] === 'iTerm2' |
| 94 | ? ['load-buffer', '-'] |
| 95 | : ['load-buffer', '-w', '-'] |
| 96 | const { code } = await execFileNoThrow('tmux', args, { |
| 97 | input: text, |
| 98 | useCwd: false, |
| 99 | timeout: 2000, |
| 100 | }) |
| 101 | return code === 0 |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * OSC 52 clipboard write: ESC ] 52 ; c ; <base64> BEL/ST |
no test coverage detected