* Checks if a tmux session exists
(sessionName: string)
| 158 | * Checks if a tmux session exists |
| 159 | */ |
| 160 | async function hasSession(sessionName: string): Promise<boolean> { |
| 161 | const result = await execFileNoThrow(TMUX_COMMAND, [ |
| 162 | 'has-session', |
| 163 | '-t', |
| 164 | sessionName, |
| 165 | ]) |
| 166 | return result.code === 0 |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Creates a new tmux session if it doesn't exist |
no test coverage detected