1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 12:48:01 +00:00

Add the ability to specify tmux session name

This commit is contained in:
Matt Henkel 2017-05-02 17:57:00 -07:00 committed by Kaleb Elwert
parent 871b15663c
commit d02c2951b3
3 changed files with 8 additions and 1 deletions

View File

@ -23,6 +23,10 @@ following line to *zpreztorc*:
In both cases, it will create a background session named _prezto_ if the tmux In both cases, it will create a background session named _prezto_ if the tmux
server is not started. 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 With `auto-start` enabled, you may want to control how multiple sessions are
managed. The `destroy-unattached` option of tmux controls if the unattached managed. The `destroy-unattached` option of tmux controls if the unattached
sessions must be kept alive, making sessions available for later use, configured sessions must be kept alive, making sessions available for later use, configured

View File

@ -31,7 +31,7 @@ if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && ( \
# Create a 'prezto' session if no session has been defined in tmux.conf. # Create a 'prezto' session if no session has been defined in tmux.conf.
if ! tmux has-session 2> /dev/null; then if ! tmux has-session 2> /dev/null; then
tmux_session='prezto' zstyle -s ':prezto:module:tmux' tmux_session 'session' || tmux_session='prezto'
tmux \ tmux \
new-session -d -s "$tmux_session" \; \ new-session -d -s "$tmux_session" \; \
set-option -t "$tmux_session" destroy-unattached off &> /dev/null set-option -t "$tmux_session" destroy-unattached off &> /dev/null

View File

@ -176,3 +176,6 @@ zstyle ':prezto:module:prompt' theme 'sorin'
# Integrate with iTerm2. # Integrate with iTerm2.
# zstyle ':prezto:module:tmux:iterm' integrate 'yes' # zstyle ':prezto:module:tmux:iterm' integrate 'yes'
# Set the default session name:
# zstyle ':prezto:module:tmux' session 'YOUR DEFAULT SESSION NAME'