function ssh -d "ssh wrapper: tint the kitty tab by target host, reset on exit"
    if not set -q KITTY_WINDOW_ID; or not type -q kitten
        command ssh $argv
        return $status
    end
    __kitty_tab_set (__kitty_ssh_host $argv)
    command ssh $argv
    set -l rc $status
    __kitty_tab_reset
    return $rc
end
