diff --git a/modules/home/cli-apps/bash/default.nix b/modules/home/cli-apps/bash/default.nix index d6d316e..11c923b 100644 --- a/modules/home/cli-apps/bash/default.nix +++ b/modules/home/cli-apps/bash/default.nix @@ -21,6 +21,7 @@ in enable = true; initExtra = '' function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; }; + function tsh() { ssh -t "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; }; ''; }; }; diff --git a/modules/home/cli-apps/fish/default.nix b/modules/home/cli-apps/fish/default.nix index ca22cdc..a6f2354 100644 --- a/modules/home/cli-apps/fish/default.nix +++ b/modules/home/cli-apps/fish/default.nix @@ -24,6 +24,13 @@ in ${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0 end end + function tsh --wraps ssh --description 'ssh with tmux' + if not set -q argv[1] + echo 'Usage: tsh [user@]host [command]' + else + ${pkgs.openssh}/bin/ssh -t $argv -- tmux new-session -A -s 0 + end + end ''; plugins = [{