add kitten ssh | ssh alias

This commit is contained in:
cswimr 2025-02-02 18:52:28 -06:00
parent 6d567a5e6e
commit 712c2c2163
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -1,6 +1,7 @@
from os.path import dirname
from os import environ
from pathlib import Path
from shutil import which
import subprocess
from socket import gethostname
import colors
@ -39,6 +40,13 @@ def run(cmd: list[str], cwd: Path = Path.cwd(), exit_on_error: bool = True, env:
def _sudo(args):
return ["sudo", "--", *aliases.eval_alias(args)]
@aliases.register
@aliases.return_command
def _ssh(args):
if which("kitten"):
return ["kitten", "ssh", *args]
return ["ssh", *args]
@aliases.register
def _vm(args):
if not args: