Allow auto-attaching tmux when connecting via ssh

This commit is contained in:
David Morgan 2022-11-12 20:31:46 +00:00
parent ca4e381eb7
commit a92ce69d39
Signed by: djm
GPG Key ID: C171251002C200F2
2 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,10 @@
home.username = "djm";
home.homeDirectory = "/home/djm";
home.sessionVariables = {
TMUX_AUTO_ATTACH=1;
};
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards

View File

@ -75,7 +75,7 @@
initExtra = ''
# Taken from prezto tmux plugin
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$SSH_TTY" ]]; then
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && (-z "$SSH_TTY" || -n "$TMUX_AUTO_ATTACH") ]]; then
tmux start-server
if ! tmux has-session 2> /dev/null; then