Commit ea45749
Ngo Quoc Viet
·
2026-08-20 09:36:25 -0400 EDT
parent 3604a17
fix(docs): handle session prefixes in picker (#239)
1 files changed,
+5,
-0
+5,
-0
| ... | ... | @@ -272,11 +272,16 @@ Requires [fzf](https://github.com/junegunn/fzf). | |
| 272 | 272 | ```bash | |
| 273 | 273 | zmx-select() { | |
| 274 | 274 | local display | |
| 275 | + | local prefix="${ZMX_SESSION_PREFIX:-}" | |
| 275 | 276 | display=$(zmx list 2>/dev/null | while IFS=$'\t' read -r name pid clients created dir; do | |
| 276 | 277 | name=${name#*name=} | |
| 277 | 278 | pid=${pid#*pid=} | |
| 278 | 279 | clients=${clients#*clients=} | |
| 279 | 280 | dir=${dir#*start_dir=} | |
| 281 | + | if [[ -n "$prefix" ]]; then | |
| 282 | + | [[ "$name" == "$prefix"* ]] || continue | |
| 283 | + | name=${name#"$prefix"} | |
| 284 | + | fi | |
| 280 | 285 | printf "%-20s pid:%-8s clients:%-2s %s\n" "$name" "$pid" "$clients" "$dir" | |
| 281 | 286 | done) | |
| 282 | 287 |