Browse Source

* revert auto tmux attach logic for only if TMUX is empty and if SSH_CONNECTION is active

* use tmux 3+ config by default
* fix default EDITOR set to vim
* remove unnecessary PATH definition (previously used for correct environment for proxmox pct enter command)
master
dimti 1 year ago
parent
commit
aeb7bd17f5
  1. 2
      .bashrc
  2. 7
      .shell-env
  3. 22
      .tmux.2.8.conf
  4. 22
      .tmux.conf

2
.bashrc

@ -79,6 +79,6 @@ export LC_ALL=en_US.UTF-8
export LANG=ru_RU.UTF-8 export LANG=ru_RU.UTF-8
# auto into tmux session # auto into tmux session
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] || [[ -n "$PS1" ]] && [[ $TMUX == *"//"* ]]; then
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
sudo tmux attach || sudo tmux sudo tmux attach || sudo tmux
fi fi

7
.shell-env

@ -3,7 +3,7 @@
## ##
## Editors ## Editors
## ##
export EDITOR=nvim
export EDITOR=vim
export TERMINAL=alacritty export TERMINAL=alacritty
export GIT_EDITOR="$EDITOR" export GIT_EDITOR="$EDITOR"
export USE_EDITOR="$EDITOR" export USE_EDITOR="$EDITOR"
@ -21,8 +21,3 @@ if [ -f "$HOME/.shell-env.local" ]; then
fi fi
umask 022 umask 022
##
## Correct PATH for tmux enter
##
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

22
.tmux.2.9+.conf → .tmux.2.8.conf

@ -65,20 +65,26 @@ set -g status-left ''
# Status bar - right side # Status bar - right side
set -g status-right-length 100 set -g status-right-length 100
set -g status-right-style fg=black,bold
set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P '
set -g status-right-fg black
set -g status-right-attr bold
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
set -g status-right "$wg_is_keys_off #{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P "
# Window status - not the current window # Window status - not the current window
set -g window-status-style bg=default,fg=white,none
set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
set-window-option -g window-status-bg default
set-window-option -g window-status-fg white
set-window-option -g window-status-attr none
set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Window status - current window # Window status - current window
set -g window-status-current-style none
set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
set-window-option -g window-status-current-attr none
set-window-option -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Pane borders # Pane borders
set -g pane-border-style bg=default,fg=colour235
set -g pane-active-border-style bg=default,fg=colour214
set -g pane-border-bg default
set -g pane-border-fg colour235
set -g pane-active-border-bg default
set -g pane-active-border-fg colour214
# Pane number display # Pane number display
set-option -g display-panes-active-colour colour214 set-option -g display-panes-active-colour colour214

22
.tmux.conf

@ -65,26 +65,20 @@ set -g status-left ''
# Status bar - right side # Status bar - right side
set -g status-right-length 100 set -g status-right-length 100
set -g status-right-fg black
set -g status-right-attr bold
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
set -g status-right "$wg_is_keys_off #{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P "
set -g status-right-style fg=black,bold
set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P '
# Window status - not the current window # Window status - not the current window
set-window-option -g window-status-bg default
set-window-option -g window-status-fg white
set-window-option -g window-status-attr none
set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
set -g window-status-style bg=default,fg=white,none
set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Window status - current window # Window status - current window
set-window-option -g window-status-current-attr none
set-window-option -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
set -g window-status-current-style none
set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
# Pane borders # Pane borders
set -g pane-border-bg default
set -g pane-border-fg colour235
set -g pane-active-border-bg default
set -g pane-active-border-fg colour214
set -g pane-border-style bg=default,fg=colour235
set -g pane-active-border-style bg=default,fg=colour214
# Pane number display # Pane number display
set-option -g display-panes-active-colour colour214 set-option -g display-panes-active-colour colour214

Loading…
Cancel
Save