From e5b671f08794cc9a546438be472ea0a3193725f2 Mon Sep 17 00:00:00 2001 From: dimti Date: Thu, 31 Aug 2023 09:16:42 +0300 Subject: [PATCH] * cmd duration in starship config moved right after directory name * automatic attach tmux for all cases include existing $TMUX variable, but only if contains double slash in the contain path (that is signal about parent TMUX session - may be unstable solution) * reassign PATH variable in shell-env bashrc include script for resolve incorrect value of that if use pct enter command in proxmox * information marker about turned off modifier key of nested session --- .bashrc | 2 +- .config/starship.toml | 3 ++- .shell-env | 5 +++++ .tmux.conf | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 724351d..94c7240 100644 --- a/.bashrc +++ b/.bashrc @@ -79,6 +79,6 @@ export LC_ALL=en_US.UTF-8 export LANG=ru_RU.UTF-8 # auto into tmux session -if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then +if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] || [[ -n "$PS1" ]] && [[ $TMUX == *"//"* ]]; then sudo tmux attach || sudo tmux fi diff --git a/.config/starship.toml b/.config/starship.toml index f4df3cf..93c4541 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,15 +1,16 @@ format = """ -$cmd_duration\ $git_branch\ $git_status\ $username\ @\ $directory\ +$cmd_duration\ $line_break\ $character\ """ add_newline = false +command_timeout = 1000 [line_break] disabled = false diff --git a/.shell-env b/.shell-env index ba68c69..876e905 100644 --- a/.shell-env +++ b/.shell-env @@ -21,3 +21,8 @@ if [ -f "$HOME/.shell-env.local" ]; then fi umask 022 + +## +## Correct PATH for tmux enter +## +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/.tmux.conf b/.tmux.conf index f32a18e..7784375 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -67,7 +67,8 @@ set -g status-left '' set -g status-right-length 100 set -g status-right-fg black set -g status-right-attr 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 ' +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 set-window-option -g window-status-bg default