Commit 520610e
Make Server.has_session() use returncode
has_session() would erroneously return true if tmux returned an unexpected
string, such as "no current session".
Instead of adding yet another string to the list to check against, use the
return code of the 'tmux has-session' command, which is documented to return 0
(Shell true) if targeted session exists, and return 1 (Shell false) in any
other case.1 parent 178c1af commit 520610e
2 files changed
+6
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 337 | + | |
353 | 338 | | |
354 | 339 | | |
| 340 | + | |
| 341 | + | |
355 | 342 | | |
356 | 343 | | |
357 | 344 | | |
| |||
0 commit comments