From 3e7170ecf59e8c345df0ba0b4eff6c8c670e00e3 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Thu, 23 Apr 2015 21:55:03 +0200 Subject: [PATCH] fixed the maximize pane feature for the fish shell --- .tmux.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 3b4cfa9..f682e14 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -276,16 +276,16 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na # tmux -q -L swap-pane-test -f /dev/null new-session -d \; new-window \; new-window \; swap-pane -t :1 \; kill-session || { tmux display 'your tmux version has a buggy swap-pane command - see ticket #108, fixed in upstream commit 78e783e'; exit; } # __current_pane=$(tmux display -p '#{pane_id}') # -# __dead_panes=$(tmux list-panes -s -F '#{pane_dead} #{pane_id} #{pane_title}' | grep -o '^1 %.\+%.\+$' || true) -# __restore=$(echo "${__dead_panes}" | sed -n -E -e "s/^1 ${__current_pane} \[\+\](%[0-9]+)$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t ${__current_pane}/p" -e "s/^1 (%[0-9]+) \[\+\]${__current_pane}$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t \1/p" ) +# __dead_panes=$(tmux list-panes -s -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -o '^1 %.\+maximized.\+$' || true) +# __restore=$(echo "${__dead_panes}" | sed -n -E -e "s/^1 ${__current_pane} .+maximized.+(%[0-9]+)$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t ${__current_pane}/p" -e "s/^1 (%[0-9]+) .+maximized.+${__current_pane}$/tmux swap-pane -s \1 -t ${__current_pane} \; kill-pane -t \1/p" ) # # if [ x"${__restore}" = x ] ; then # [ x"$(tmux list-panes | wc -l | sed 's/^ *//g')" = x1 ] && tmux display "Can't maximize with only one pane" && return -# __window=$(tmux new-window -P "exec maximized+ 2> /dev/null | tmux setw remain-on-exit on && printf '\033]2;%s\033\\' [+]${__current_pane}") +# __window=$(tmux new-window -P "exec maximized& tmux setw remain-on-exit on; clear; tmux clear-history; printf 'Pane has been maximized, press + to restore. %s' \\${__current_pane};") # __window=${__window%.*} # -# __guard=100 -# while ( [ x"$(tmux list-panes -t ${__window} -F '#{session_name}:#{window_index} #{pane_dead}')" != x"${__window} "1 ] && [ x"${__guard}" != x0 ] ) ; do sleep 0.01 ; _guard=$((__guard - 1)) ; done +# __guard=50 +# while ( [ x"$(tmux list-panes -t ${__window} -F '#{session_name}:#{window_index} #{pane_dead}')" != x"${__window} "1 ] && [ x"${__guard}" != x0 ] ) ; do sleep 0.01 ; __guard=$((__guard - 1)); done # if [ x"${__guard}" = 0 ] ; then # exit 1 # fi