shell: add tsh alias

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2024-03-06 12:25:53 +01:00
parent 4827a3e325
commit 93e8e0fd4a
2 changed files with 8 additions and 0 deletions

View file

@ -21,6 +21,7 @@ in
enable = true; enable = true;
initExtra = '' initExtra = ''
function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; }; 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;' ; };
''; '';
}; };
}; };

View file

@ -24,6 +24,13 @@ in
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0 ${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
end end
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 = [{ plugins = [{