Switch back to tmux
This commit is contained in:
parent
d946f3b33d
commit
f4207ca303
4 changed files with 27 additions and 11 deletions
20
home/.config/tmux/tmux.conf
Normal file
20
home/.config/tmux/tmux.conf
Normal file
|
@ -0,0 +1,20 @@
|
|||
# set shell
|
||||
set -g default-shell /bin/zsh
|
||||
|
||||
# Change prefix to ctrl+a
|
||||
unbind C-b
|
||||
set -g prefix C-a
|
||||
|
||||
set -g default-terminal "tmux" # use 'tmux' instead of 'screen-*' to enable italics support per tmux FAQ
|
||||
set-option -ga terminal-overrides ",*256col*:Tc"
|
||||
|
||||
# Enable mouse
|
||||
set -g mouse on
|
||||
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'egel/tmux-gruvbox'
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
15
home/.config/zsh/01-multiplexer.zsh
Normal file
15
home/.config/zsh/01-multiplexer.zsh
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Supports 'tmux', 'zellij', 'none'
|
||||
PLEXER=tmux
|
||||
|
||||
if [[ "$PLEXER" == 'tmux' ]]; then
|
||||
PLEXER_ACTIVE="$TMUX"
|
||||
PLEXER_CMD="tmux new-session -A -s SSH"
|
||||
elif [[ "$PLEXER" == 'zellij' ]]; then
|
||||
PLEXER_ACTIVE="$ZELLIJ"
|
||||
PLEXER_CMD="zellij attach -c SSH"
|
||||
fi
|
||||
|
||||
# Launch or attach to existing multiplexer session if logging in over ssh
|
||||
if [[ -n "$PLEXER_CMD" && -z "$PLEXER_ACTIVE" && -n "$SSH_CONNECTION" ]]; then
|
||||
eval "exec $PLEXER_CMD"
|
||||
fi
|
|
@ -1,4 +0,0 @@
|
|||
# Launch or attach zellij to existing session if logging in over ssh
|
||||
if [[ -z "$ZELLIJ" && -n "$SSH_CONNECTION" ]]; then
|
||||
exec zellij attach -c SSH
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue