Unverified Commit 55682e36 authored by Shahin Sorkh's avatar Shahin Sorkh Committed by GitHub

feat(tmux): set session name with `ZSH_TMUX_DEFAULT_SESSION_NAME` (#9063)

parent 90903779
...@@ -39,3 +39,4 @@ The plugin also supports the following: ...@@ -39,3 +39,4 @@ The plugin also supports the following:
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | | `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` |
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) | | `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode | | `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled |
...@@ -76,7 +76,11 @@ function _zsh_tmux_plugin_run() { ...@@ -76,7 +76,11 @@ function _zsh_tmux_plugin_run() {
elif [[ -e "$ZSH_TMUX_CONFIG" ]]; then elif [[ -e "$ZSH_TMUX_CONFIG" ]]; then
tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") tmux_cmd+=(-f "$ZSH_TMUX_CONFIG")
fi fi
$tmux_cmd new-session if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then
$tmux_cmd new-session -s $ZSH_TMUX_DEFAULT_SESSION_NAME
else
$tmux_cmd new-session
fi
fi fi
if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment