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