From e498ef61bf1f3c78514a01ad1028b072e681d216 Mon Sep 17 00:00:00 2001 From: Ferran Basora Date: Wed, 6 Mar 2019 15:13:49 +0000 Subject: [PATCH] Fix swaping --- tmux-thumbs.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tmux-thumbs.sh b/tmux-thumbs.sh index 6389bc2..27a2c79 100755 --- a/tmux-thumbs.sh +++ b/tmux-thumbs.sh @@ -2,9 +2,7 @@ CURRENT_PANE_ID=$(tmux list-panes -F "#{pane_id}:#{?pane_active,active,nope}" | grep active | cut -d: -f1) COMMAND="tmux-thumbs -a qwerty -r -u --tmux-pane ${CURRENT_PANE_ID}" +NEW_ID=$(tmux new-window -P -d -n "[thumbs]" ${COMMAND}) +NEW_PANE_ID=$(tmux list-panes -a | grep ${NEW_ID} | grep --color=never -o '%[0-9]\+') -tmux new-window -d -n "[thumbs]" ${COMMAND} - -NEW_PANE_ID=$(tmux list-panes -a | grep 0:3.1 | grep -o '%[0-9]\+') - -tmux swap-pane -t ${NEW_PANE_ID} +tmux swap-pane -d -s ${CURRENT_PANE_ID} -t ${NEW_PANE_ID}