From 06324b0af493a9df2c3e4592f3d1f49f2978ed91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20K=C3=BCtemeier?= Date: Wed, 21 Jan 2015 21:00:36 +0100 Subject: [PATCH] option added to name the autocreated tmux session --- modules/tmux/README.md | 5 +++++ modules/tmux/init.zsh | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/tmux/README.md b/modules/tmux/README.md index b2f6bc8d..9d168d83 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 rename the default session name with: + + zstyle ':prezto:module:tmux:session' name 'your-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 @@ -67,6 +71,7 @@ Authors - [Colin Hebert](https://github.com/ColinHebert) - [Georges Discry](https://github.com/gdiscry) - [Xavier Cambar](https://github.com/xcambar) + - [Jörg Kütemeier](https://github.com/jkuetemeier) [1]: http://tmux.sourceforge.net [2]: https://github.com/sorin-ionescu/prezto/issues/62 diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index 070abcaf..05a78b48 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -6,6 +6,7 @@ # Colin Hebert # Georges Discry # Xavier Cambar +# Jörg Kütemeier # # Return if requirements are not found. @@ -31,7 +32,9 @@ 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:session' name tmux_session \ + || tmux_session='prezto' + tmux \ new-session -d -s "$tmux_session" \; \ set-option -t "$tmux_session" destroy-unattached off &> /dev/null