From d02c2951b39ceee3e37dc163661df054fb641d8d Mon Sep 17 00:00:00 2001 From: Matt Henkel Date: Tue, 2 May 2017 17:57:00 -0700 Subject: [PATCH] Add the ability to specify tmux session name --- modules/tmux/README.md | 4 ++++ modules/tmux/init.zsh | 2 +- runcoms/zpreztorc | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/tmux/README.md b/modules/tmux/README.md index 11c8a08..28695fa 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -23,6 +23,10 @@ following line to *zpreztorc*: In both cases, it will create a background session named _prezto_ if the tmux server is not started. +You can change the default session name with: + + zstyle ':prezto:module:tmux' session 'YOUR DEFAULT SESSION NAME' + With `auto-start` enabled, you may want to control how multiple sessions are managed. The `destroy-unattached` option of tmux controls if the unattached sessions must be kept alive, making sessions available for later use, configured diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index 070abca..0c3a78e 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -31,7 +31,7 @@ if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && ( \ # Create a 'prezto' session if no session has been defined in tmux.conf. if ! tmux has-session 2> /dev/null; then - tmux_session='prezto' + zstyle -s ':prezto:module:tmux' tmux_session 'session' || tmux_session='prezto' tmux \ new-session -d -s "$tmux_session" \; \ set-option -t "$tmux_session" destroy-unattached off &> /dev/null diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index e88ae3c..2ed618d 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -176,3 +176,6 @@ zstyle ':prezto:module:prompt' theme 'sorin' # Integrate with iTerm2. # zstyle ':prezto:module:tmux:iterm' integrate 'yes' + +# Set the default session name: +# zstyle ':prezto:module:tmux' session 'YOUR DEFAULT SESSION NAME'