Auto start a tmux session once shell is launched. Auto name the session as directory-hash
to keeps a consistent name for sessions created in the same directories, which means we could auto attach to an existing session.
- Creating/Attaching sessions automatically on shell run
- Consistent session name for the same directory
- Options to
- Disable auto session creating/attaching
- Kill shell automatically once u detach from a tmux session
- Custom environment variable
TERM
fortmux
commands
The only ZSH plugin manager solves the time-consuming init for nvm
, nodenv
, pyenv
, rvm
, rbenv
, thefuck
, fasd
, etc, with its amazing async Turbo Mode.
# add it into your .zshrc
zinit ice pick'init.zsh'
zinit light laggardkernel/zsh-tmux
Update the plugin with
$ zinit update laggardkernel/zsh-tmux
The only framework does optimizations in plugins with sophisticated coding skill:
- Refreshing
.zcompdump
every 20h - Compiling
.zcompdump
as bytecode in the background - Caching init script for fasd
- Saving
*env
startup time withinit - --no-rehash
forrbenv
,pyenv
,nodenv
- Removing the horribly time-consuming
brew command
fromcommand-not-found
mkdir -p ${ZDOTDIR:-$HOME}/.zprezto/contrib &>/dev/null
git clone git@github.com:laggardkernel/zsh-tmux.git ${ZDOTDIR:-$HOME}/.zprezto/contrib/zsh-tmux
# or use HTTPS instead
git clone https://github.com/laggardkernel/zsh-tmux.git ${ZDOTDIR:-$HOME}/.zprezto/contrib/zsh-tmux
Automatically attach to an existing tmux session, or create a session once the plugin is enabled. Disable auto attaching/creating with
# global setting
NO_AUTO_TMUX=1 # enabled by default
# setting for local terminal only
zstyle ':prezto:module:tmux:auto-start' local 'no' # default 'yes'
# setting for remote terminal only
zstyle ':prezto:module:tmux:auto-start' remote 'no' # default 'no'
Custom environment variable TERM
for tmux
commands.
zstyle ":prezto:module:tmux:term" with_256color "xterm-256color" # default screen-256
zstyle ":prezto:module:tmux:term" without_256color "xtermr" # default screen
Enable auto session creating/attaching support for Tmux CONTROL MODE in iTerm with
zstyle ":prezto:module:tmux:iterm" integrate "yes" # default 'no'
- [ ] Length customization for hash suffix in session name
- [ ] Setting to kill shell when detach from a session
- [ ] Setting to kill shell when exit from a session
The MIT License (MIT)
Copyright (c) 2021 laggardkernel