-
-
Save iori-yja/3902249 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind-key z run pane-maximize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while getopts b: OPT ; do | |
targetid=$OPTARG | |
done | |
currentid=$(tmux display-message -p '#{pane_id}') | |
tztable=$(tmux showenv tztable | sed "s/^tztable=//") | |
if [ -n "$targetid" ] ; then | |
tmux swap-pane -t $targetid -s $currentid \; \ | |
setenv tztable "$tztable:$targetid=$currentid" | |
echo "******************************" | |
echo "**** this is a dummy pane ****" | |
echo "******************************" | |
while : ; do read ; done | |
elif targets=$(echo $tztable | sed "s/:/\n/g" | tail -n +2 | grep "^$currentid=") ; then | |
targetid=$(echo $targets | sed "s/^.*=//" | head -n 1) | |
tmux swap-pane -t $targetid -s $currentid \; \ | |
kill-pane -t $targetid \; \ | |
setenv tztable "$(echo $tztable | sed "s/:$currentid=[^:]*//")" | |
else | |
tmux new-window "$0 -b $currentid" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment