From 960eec1a8d57b57c2f6d2017c1e97365173126ba Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 28 Mar 2024 09:53:02 +0300 Subject: [PATCH] tmux group session each terminal --- home/user/.config/tmux/style.conf | 2 +- home/user/.config/zsh/.zshrc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home/user/.config/tmux/style.conf b/home/user/.config/tmux/style.conf index 41d4a03..40cce4f 100644 --- a/home/user/.config/tmux/style.conf +++ b/home/user/.config/tmux/style.conf @@ -15,7 +15,7 @@ set -g window-status-style 'bg=default' set -g window-status-current-style 'bg=white,fg=black bold' set -g window-status-format '#W#{?window_flags,#{window_flags}, }' set -g window-status-current-format '#W#{?window_flags,#{window_flags}, }' -setw -g monitor-activity on +setw -g monitor-activity off # window title style set -g set-titles on diff --git a/home/user/.config/zsh/.zshrc b/home/user/.config/zsh/.zshrc index cbe64ce..5dc6907 100644 --- a/home/user/.config/zsh/.zshrc +++ b/home/user/.config/zsh/.zshrc @@ -1,8 +1,14 @@ # .zshrc by TheK4n # https://github.com/TheK4n/dotfiles +TMUX_MAIN_SESSION="main" + if command -v tmux &>/dev/null && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then - exec tmux + if tmux has-session -t "$TMUX_MAIN_SESSION" &>/dev/null; then + exec tmux new-session -t "$TMUX_MAIN_SESSION" + else + exec tmux new-session -s "$TMUX_MAIN_SESSION" + fi fi if [ -f "$ZDOTDIR/sourcer" ]; then