From a4f6249e4ff59c09c586232c31b00f2658cd1140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Chocholat=C3=BD?= Date: Sat, 2 Nov 2024 01:55:44 +0000 Subject: [PATCH] Fix shell script to select a session to attach to The format of the `zellij list-sessions` changed. To keep the colourful output as well as the additional information for the user, `--no-formatting` flag is not used. Instead, the line selected by the fuzzy finder gets trimmed to the first column (delimited by whitespace) with the session name. The no longer maintained fuzzy finder `skim` is replaced with `fzf`. --- docs/src/integration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/integration.md b/docs/src/integration.md index c716814..ba2aba0 100644 --- a/docs/src/integration.md +++ b/docs/src/integration.md @@ -63,16 +63,16 @@ The following environment variables can also be used in the provided script. ## List current sessions List current sessions, attach to a running session, or create a new one. -Depends on [`sk`](https://github.com/lotabout/skim) & `bash` +Depends on [`fzf`](https://github.com/junegunn/fzf) & `bash`. -``` +```sh #!/usr/bin/env bash ZJ_SESSIONS=$(zellij list-sessions) NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l) if [ "${NO_SESSIONS}" -ge 2 ]; then zellij attach \ - "$(echo "${ZJ_SESSIONS}" | sk)" + "$(echo "${ZJ_SESSIONS}" | fzf --bind 'enter:become(echo {1})' --ansi)" else zellij attach -c fi