From 5133275e1539831bf2f91525784a9682c4835f56 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Thu, 17 Sep 2015 22:16:29 +0200 Subject: [PATCH] detect old or new tmux mouse support and use proper options accordingly --- .tmux.conf | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index f9c92f4..4628c37 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -303,17 +303,34 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na # } # # toggle_mouse() { -# old=$(tmux show -g | grep mouse | head -n 1 | cut -d' ' -f2) -# new="" +# if (tmux show -g -w |grep -q mode-mouse); then +# old=$(tmux show -g -w | grep mode-mouse | cut -d' ' -f2) +# new="" # -# if [ "$old" = "on" ] ; then -# new="off" +# if [ "$old" = "on" ] ; then +# new="off" +# else +# new="on" +# fi +# +# tmux set -g mode-mouse $new \;\ +# set -g mouse-resize-pane $new \;\ +# set -g mouse-select-pane $new \;\ +# set -g mouse-select-window $new \;\ +# display "mouse: $new" # else -# new="on" -# fi +# old=$(tmux show -g | grep mouse | head -n 1 | cut -d' ' -f2) +# new="" # -# tmux set -g mouse $new \;\ -# display "mouse: $new" +# if [ "$old" = "on" ] ; then +# new="off" +# else +# new="on" +# fi +# +# tmux set -g mouse $new \;\ +# display "mouse: $new" +# fi # } # # battery() {