tmux mapping choose session fix
This commit is contained in:
parent
0f001c52d5
commit
033425f869
@ -17,13 +17,18 @@ tab:replace-query,\
|
||||
shift-tab:toggle\
|
||||
"
|
||||
|
||||
declare current_session
|
||||
current_session="$(tmux display-message -p '#S')"
|
||||
readonly current_session
|
||||
|
||||
declare sessions
|
||||
sessions="$(tmux list-session -F '#S')"
|
||||
sessions="$(tmux list-session -F '#S#{?session_attached, (attached),}')"
|
||||
sessions="$(echo "${sessions}" | sed "s/^${current_session} /${current_session} (current) /")"
|
||||
readonly sessions
|
||||
|
||||
|
||||
declare session
|
||||
session="$(echo "${sessions}" | fzf +m --preview-window 75%,follow --preview 'tmux capture-pane -p -e -t {1}')"
|
||||
session="$(echo "${sessions}" | fzf +m --preview-window 75%,follow --preview 'tmux capture-pane -p -e -t {1}' | awk '{printf $1}')"
|
||||
readonly session
|
||||
|
||||
if [[ -n "${session}" ]]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user