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).
272272 ```bash
273273 zmx-select() {
274274 local display
275+ local prefix="${ZMX_SESSION_PREFIX:-}"
275276 display=$(zmx list 2>/dev/null | while IFS=$'\t' read -r name pid clients created dir; do
276277 name=${name#*name=}
277278 pid=${pid#*pid=}
278279 clients=${clients#*clients=}
279280 dir=${dir#*start_dir=}
281+ if [[ -n "$prefix" ]]; then
282+ [[ "$name" == "$prefix"* ]] || continue
283+ name=${name#"$prefix"}
284+ fi
280285 printf "%-20s pid:%-8s clients:%-2s %s\n" "$name" "$pid" "$clients" "$dir"
281286 done)
282287