Reattach tmux session if one exists
Tmux tweaks
This commit is contained in:
parent
6aefa9ad43
commit
d82bed4d98
@ -249,7 +249,14 @@ if [ "$TMUX_START" == "y" ]; then
|
||||
|
||||
# Start tmux
|
||||
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
|
||||
# Check if there are any existing tmux sessions
|
||||
if tmux list-sessions &> /dev/null; then
|
||||
# Attach to the first available session
|
||||
exec tmux attach-session -t "$(tmux list-sessions -F '#{session_name}' | head -n 1)"
|
||||
else
|
||||
# Create a new session if no sessions exist
|
||||
exec tmux
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
else
|
||||
|
@ -3,11 +3,18 @@ bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "Config re
|
||||
|
||||
# Bind Ctrl + Space to enter copy mode
|
||||
bind -n C-Space copy-mode
|
||||
|
||||
set-option -g status-keys vi
|
||||
set-window-option -g mode-keys vi
|
||||
set -g status-right "#[fg=yellow]Copy Mode#[default]"
|
||||
|
||||
set -g status on
|
||||
|
||||
set -g status-justify left
|
||||
|
||||
set -g remain-on-exit off
|
||||
set -g exit-empty on
|
||||
|
||||
# The problem with enabling mouse support is that it doesn't work in any other app
|
||||
# set -g mouse on
|
||||
|
||||
@ -23,11 +30,11 @@ set -sa terminal-overrides "*:Tc"
|
||||
set -g @dracula-plugins "battery weather time"
|
||||
set -g @dracula-show-empty-plugins false
|
||||
|
||||
set -g @dracula-left-icon-padding 0
|
||||
set -g @dracula-left-icon-padding 1
|
||||
|
||||
set -g @dracula-show-powerline true
|
||||
set -g @dracula-show-left-sep
|
||||
set -g @dracula-show-right-sep
|
||||
set -g @dracula-show-powerline false
|
||||
#set -g @dracula-show-left-sep
|
||||
#set -g @dracula-show-right-sep
|
||||
|
||||
set -g @dracula-battery-label false
|
||||
set -g @dracula-show-battery-status true
|
||||
|
Loading…
x
Reference in New Issue
Block a user