I use a small macOS Automator script to ssh into a remote host so I can add it to the Dock:
tell application "Terminal"
activate
do script ("ssh [email protected];")
end tell
When used the first time, I get the expected remote Terminal window, but also an extra local Terminal window. All subsequent uses only generate a single window to the remote host.
I've tried some small alternatives like:
set currentWindow to do script...
and:
set currentTab to do script...
with the same result. Is there any way to prevent the initial local Terminal window?
I found a post that has the answer: