| 31 | } |
| 32 | |
| 33 | export function tmuxSend( |
| 34 | sessionName: string, |
| 35 | text: string, |
| 36 | options?: { noEnter?: boolean; waitIdle?: number; force?: boolean }, |
| 37 | ): void { |
| 38 | const args: string[] = [ |
| 39 | `${SCRIPTS_DIR}/tmux-send.sh`, |
| 40 | sessionName, |
| 41 | text, |
| 42 | ] |
| 43 | if (options?.noEnter) args.push('--no-enter') |
| 44 | if (options?.waitIdle) args.push('--wait-idle', String(options.waitIdle)) |
| 45 | if (options?.force) args.push('--force') |
| 46 | |
| 47 | execFileSync('bash', args, EXEC_OPTIONS) |
| 48 | } |
| 49 | |
| 50 | export function tmuxSendKey(sessionName: string, key: string): void { |
| 51 | execFileSync( |