From 105fb54755b0183fc160b76167e86e5c4f35a8d3 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Fri, 20 Jul 2018 12:01:35 -0400 Subject: [PATCH 1/7] Added syncing indicator to tmux status line This checks for if the panes are synced or not, and provides and indicator resembling it in the status bar. --- .tmux.conf | 11 +++++++++++ .tmux.conf.local | 9 ++++++++- README.md | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 045cf0f..62a92da 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -828,6 +828,11 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-'none'} # tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-'bold,blink'} # +# tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-'🔒'} # U+1F512 +# tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-'none'} +# tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-'none'} +# tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-'none'} +# # # -- status left style # # tmux_conf_theme_status_left=${tmux_conf_theme_status_left-' ❐ #S '} @@ -844,6 +849,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ # -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") # +# tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \ +# -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") +# # if [ -n "$tmux_conf_theme_status_left" ]; then # status_left=$(awk \ # -v fg_="$tmux_conf_theme_status_left_fg" \ @@ -928,6 +936,9 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ # -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g") # +# tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \ +# -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g") +# # if [ -n "$tmux_conf_theme_status_right" ]; then # status_right=$(awk \ # -v fg_="$tmux_conf_theme_status_right_fg" \ diff --git a/.tmux.conf.local b/.tmux.conf.local index ae45b07..cd16497 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -151,6 +151,7 @@ tmux_conf_theme_right_separator_sub='|' # - #{pairing} # - #{prefix} # - #{root} +# - #{synchronized} # - #{uptime_d} # - #{uptime_h} # - #{uptime_m} @@ -158,7 +159,7 @@ tmux_conf_theme_right_separator_sub='|' # - #{username} # - #{username_ssh} tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} ' -tmux_conf_theme_status_right='#{prefix}#{pairing} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} ' +tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} ' # status left style tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white @@ -188,6 +189,12 @@ tmux_conf_theme_root_fg='none' tmux_conf_theme_root_bg='none' tmux_conf_theme_root_attr='bold,blink' +# synchronized indicator +tmux_conf_theme_synchronized='🔒' # U+1F512 +tmux_conf_theme_synchronized_fg='none' +tmux_conf_theme_synchronized_bg='none' +tmux_conf_theme_synchronized_attr='none' + # battery bar symbols tmux_conf_battery_bar_symbol_full='◼' tmux_conf_battery_bar_symbol_empty='◻' diff --git a/README.md b/README.md index b5bfbcc..a82ea00 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,7 @@ This configuration supports the following builtin variables: - `#{pairing}`: is session attached to more than one client? - `#{prefix}`: is prefix being depressed? - `#{root}`: is current user root? + - `#{synchronized}`: are the panes synchronized? - `#{uptime_d}`: uptime days - `#{uptime_h}`: uptime hours - `#{uptime_m}`: uptime minutes From 7ebc59956a8d550bf06085b7d273221958c4a097 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Thu, 5 Jul 2018 09:23:59 +0200 Subject: [PATCH 2/7] do not use repeatable bindings for pane and windows navigation. Fixes #166 --- .tmux.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 62a92da..024c2e4 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -68,10 +68,10 @@ bind - split-window -v bind _ split-window -h # pane navigation -bind -r h select-pane -L # move left -bind -r j select-pane -D # move down -bind -r k select-pane -U # move up -bind -r l select-pane -R # move right +bind h select-pane -L # move left +bind j select-pane -D # move down +bind k select-pane -U # move up +bind l select-pane -R # move right bind > swap-pane -D # swap current pane with the next one bind < swap-pane -U # swap current pane with the previous one @@ -87,8 +87,8 @@ bind -r L resize-pane -R 2 # window navigation unbind n unbind p -bind -r C-h previous-window # select previous window -bind -r C-l next-window # select next window +bind C-h previous-window # select previous window +bind C-l next-window # select next window bind Tab last-window # move to last active window # toggle mouse From 08334a6451e3678f92679c91c39d69c97d713126 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Thu, 19 Jul 2018 08:55:10 +0200 Subject: [PATCH 3/7] accomodate for slow shell init in _maximize_pane(). Fixes #170 --- .tmux.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 024c2e4..142d5f3 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -205,12 +205,12 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # window=$(tmux new-window -t "$current_session:" -P "exec maximized... 2> /dev/null & tmux setw -t \"$current_session:\" remain-on-exit on; printf \"Pane has been maximized, press + to restore. %s\" '$current_pane'") # window=${window%.*} # -# guard=10 -# while [ x"$(tmux list-panes -t "$window" -F '#{session_name}:#{window_index} #{pane_dead}' 2>/dev/null)" != x"$window 1" ] && [ "$guard" -ne 0 ]; do -# sleep 0.01 -# guard=$((guard - 1)) +# retry=10 +# while [ x"$(tmux list-panes -t "$window" -F '#{session_name}:#{window_index} #{pane_dead}' 2>/dev/null)" != x"$window 1" ] && [ "$retry" -ne 0 ]; do +# sleep 0.05 +# retry=$((retry - 1)) # done -# if [ "$guard" -eq 0 ]; then +# if [ "$retry" -eq 0 ]; then # tmux display 'Unable to maximize pane' # fi # From 6679c0af2cdb20a11f78d3bd8fe103626bb413e4 Mon Sep 17 00:00:00 2001 From: Divo Kaplan Date: Fri, 3 Aug 2018 23:08:39 +0300 Subject: [PATCH 4/7] Fixed missing vi-copy / copy-mode-vi H/L keybindings. Fixes #175 --- .tmux.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 142d5f3..7580d8c 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -139,6 +139,8 @@ run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/nu run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' +run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' +run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' # copy to Mac OSX clipboard From 3d706977c8adc0a33123c4940b6860a0c8c9e8ec Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sat, 11 Aug 2018 16:52:48 +0200 Subject: [PATCH 5/7] added tmux_conf_theme_terminal_title. Fixes #168 --- .tmux.conf | 22 ++++++++++++++++------ .tmux.conf.local | 10 ++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 7580d8c..2aa2624 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -32,14 +32,13 @@ bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' # -- display ------------------------------------------------------------------- -set -g base-index 1 # start windows numbering at 1 -setw -g pane-base-index 1 # make pane numbering consistent with windows +set -g base-index 1 # start windows numbering at 1 +setw -g pane-base-index 1 # make pane numbering consistent with windows -setw -g automatic-rename on # rename window to reflect current program -set -g renumber-windows on # renumber windows when a window is closed +setw -g automatic-rename on # rename window to reflect current program +set -g renumber-windows on # renumber windows when a window is closed -set -g set-titles on # set terminal title -set -g set-titles-string '#h ❐ #S ● #I #W' +set -g set-titles on # set terminal title set -g display-panes-time 800 # slightly longer pane indicators display time set -g display-time 1000 # slightly longer status messages display time @@ -775,6 +774,17 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # set -g status-left-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ # set -g status-right-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" # +# tmux_conf_theme_terminal_title=${tmux_conf_theme_terminal_title:-'#h ❐ #S ● #I #W'} +# +# tmux_conf_theme_terminal_title=$(echo "$tmux_conf_theme_terminal_title" | sed \ +# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \ +# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \ +# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ +# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ +# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ +# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') +# tmux set -g set-titles-string "$tmux_conf_theme_terminal_title" +# # tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-'#8a8a8a'} # white # tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-'#080808'} # dark gray # tmux_conf_theme_window_status_attr=${tmux_conf_theme_window_status_attr:-'none'} diff --git a/.tmux.conf.local b/.tmux.conf.local index cd16497..3abde50 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -90,6 +90,16 @@ tmux_conf_theme_status_fg='#8a8a8a' # light gray tmux_conf_theme_status_bg='#080808' # dark gray tmux_conf_theme_status_attr='none' +# terminal title +# - built-in variables are: +# - #{circled_window_index} +# - #{circled_session_name} +# - #{hostname} +# - #{hostname_ssh} +# - #{username} +# - #{username_ssh} +tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W' + # window status style # - built-in variables are: # - #{circled_window_index} From b3a9f75ea6257c436827648bdbb3fef609cd5c68 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sat, 11 Aug 2018 16:54:04 +0200 Subject: [PATCH 6/7] made window titles support additional variables. Fixes #178 tmux_conf_theme_window_status_format and tmux_conf_theme_window_status_current_format variables now understand: - #{circled_session_name} - #{hostname} - #{hostname_ssh} - #{username} - #{username_ssh} --- .tmux.conf | 16 ++++++++++++++-- .tmux.conf.local | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 2aa2624..348c246 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -800,8 +800,20 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux_conf_theme_window_status_current_format="#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg]$tmux_conf_theme_left_separator_main#[fg=default,bg=default,default] $tmux_conf_theme_window_status_current_format #[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg,none]$tmux_conf_theme_left_separator_main" # fi # -# tmux_conf_theme_window_status_format=$(echo "$tmux_conf_theme_window_status_format" | sed 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g') -# tmux_conf_theme_window_status_current_format=$(echo "$tmux_conf_theme_window_status_current_format" | sed 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g') +# tmux_conf_theme_window_status_format=$(echo "$tmux_conf_theme_window_status_format" | sed \ +# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \ +# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \ +# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ +# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ +# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ +# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') +# tmux_conf_theme_window_status_current_format=$(echo "$tmux_conf_theme_window_status_current_format" | sed \ +# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \ +# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \ +# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \ +# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \ +# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \ +# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g') # # tmux setw -g window-status-style "fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg,$tmux_conf_theme_window_status_attr" \;\ # setw -g window-status-format "$tmux_conf_theme_window_status_format" \;\ diff --git a/.tmux.conf.local b/.tmux.conf.local index 3abde50..d68c789 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -103,6 +103,11 @@ tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W' # window status style # - built-in variables are: # - #{circled_window_index} +# - #{circled_session_name} +# - #{hostname} +# - #{hostname_ssh} +# - #{username} +# - #{username_ssh} tmux_conf_theme_window_status_fg='#8a8a8a' # light gray tmux_conf_theme_window_status_bg='#080808' # dark gray tmux_conf_theme_window_status_attr='none' @@ -113,6 +118,11 @@ tmux_conf_theme_window_status_format='#I #W' # window current status style # - built-in variables are: # - #{circled_window_index} +# - #{circled_session_name} +# - #{hostname} +# - #{hostname_ssh} +# - #{username} +# - #{username_ssh} tmux_conf_theme_window_status_current_fg='#000000' # black tmux_conf_theme_window_status_current_bg='#00afff' # light blue tmux_conf_theme_window_status_current_attr='bold' From ffb1c54769fc78643328ff0ebdc266a99537d3fa Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Tue, 21 Aug 2018 22:46:02 +0200 Subject: [PATCH 7/7] Revert "do not use repeatable bindings for pane and windows navigation. Fixes #166" This reverts commit 7ebc59956a8d550bf06085b7d273221958c4a097. --- .tmux.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 348c246..b650e6f 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -67,10 +67,10 @@ bind - split-window -v bind _ split-window -h # pane navigation -bind h select-pane -L # move left -bind j select-pane -D # move down -bind k select-pane -U # move up -bind l select-pane -R # move right +bind -r h select-pane -L # move left +bind -r j select-pane -D # move down +bind -r k select-pane -U # move up +bind -r l select-pane -R # move right bind > swap-pane -D # swap current pane with the next one bind < swap-pane -U # swap current pane with the previous one @@ -86,8 +86,8 @@ bind -r L resize-pane -R 2 # window navigation unbind n unbind p -bind C-h previous-window # select previous window -bind C-l next-window # select next window +bind -r C-h previous-window # select previous window +bind -r C-l next-window # select next window bind Tab last-window # move to last active window # toggle mouse