put these 4 lines in the `if (!tmate_host)` conditional.
No need for it if it's specified