Allow auto-attaching tmux when connecting via ssh
This commit is contained in:
parent
ca4e381eb7
commit
a92ce69d39
|
@ -12,6 +12,10 @@
|
||||||
home.username = "djm";
|
home.username = "djm";
|
||||||
home.homeDirectory = "/home/djm";
|
home.homeDirectory = "/home/djm";
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
TMUX_AUTO_ATTACH=1;
|
||||||
|
};
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
# when a new Home Manager release introduces backwards
|
# when a new Home Manager release introduces backwards
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
# Taken from prezto tmux plugin
|
# 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
|
tmux start-server
|
||||||
|
|
||||||
if ! tmux has-session 2> /dev/null; then
|
if ! tmux has-session 2> /dev/null; then
|
||||||
|
|
Loading…
Reference in New Issue