Set TMUX shell based on condition

This commit is contained in:
2024-10-13 19:39:23 +01:00
parent db70dce573
commit 4183ab9d34

View File

@@ -533,6 +533,7 @@ in
plugins = with pkgs; [ tmuxPlugins.cpu ];
prefix = "C-s";
terminal = "tmux-256color";
shell = if isLinux then "${pkgs.zsh}/bin/zsh" else "/bin/zsh";
extraConfig = ''
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
@@ -641,6 +642,13 @@ in
set -o vi
export EDITOR="nvim";
export PS1="\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ ";
if [[ -z $TMUX ]]; then
tmux attach
if [[ $? == 1 ]]; then
tmux new -s main
fi
fi
'';
};
@@ -672,6 +680,13 @@ in
set -o vi
export EDITOR="nvim";
if [[ -z $TMUX ]]; then
tmux attach
if [[ $? == 1 ]]; then
tmux new -s main
fi
fi
'';
};