Commit 61e5cb2
Zixuan Song
·
2026-07-22 10:10:04 -0400 EDT
parent 4ab0a60
doc: add alternative gentle-hint pattern for server SSH workflow (#175) The existing session-picker docs only show an auto-launch pattern (zmx-select && exit), which forces the picker on every SSH login. This is inconvenient on shared servers where quick commands are common. Add an alternative 'gentle hint' pattern that shows a one-line reminder when sessions exist, without blocking the shell.
1 files changed,
+19,
-0
+19,
-0
| ... | ... | @@ -282,6 +282,25 @@ if command -v zmx &> /dev/null && command -v fzf &> /dev/null && [[ -z "$ZMX_SES | |
| 282 | 282 | fi | |
| 283 | 283 | ``` | |
| 284 | 284 | ||
| 285 | + | #### Alternative: gentle hint (server use) | |
| 286 | + | ||
| 287 | + | If you use zmx on a shared server and SSH in frequently for quick operations, | |
| 288 | + | auto-launching the picker on every connection may be too aggressive. Instead, | |
| 289 | + | show a one-line reminder when active sessions exist: | |
| 290 | + | ||
| 291 | + | ```bash | |
| 292 | + | if command -v zmx &> /dev/null && [[ -z "$ZMX_SESSION" ]]; then | |
| 293 | + | local count | |
| 294 | + | count=$(zmx ls --short 2>/dev/null | wc -l) | |
| 295 | + | if [[ "$count" -gt 0 ]]; then | |
| 296 | + | echo "zmx: $count session(s) active — \`zmx-select\` to attach" >&2 | |
| 297 | + | fi | |
| 298 | + | fi | |
| 299 | + | ``` | |
| 300 | + | ||
| 301 | + | Choose the auto-launch pattern for dedicated dev machines, and the hint | |
| 302 | + | pattern for shared servers where you frequently run quick commands. | |
| 303 | + | ||
| 285 | 304 | </details> | |
| 286 | 305 | ||
| 287 | 306 | ## session prefix |