I'm trying to have a shell script I can use to do connect somemachine
to simplify the following pattern
ssh somemachine
tmux a
I've tried using here docs as Python subprocess with heredocs in order to send "tmux a" command
#!/bin/bash
ssh $1@$2 << 'ENDSSH'
tmux a
ENDSSH
however that fails with "stdin is not a terminal". Following suggestion in Pseudo-terminal will not be allocated because stdin is not a terminal I did following modification
#!/bin/bash
ssh -tt $1@$2 << 'ENDSSH'
tmux a
ENDSSH
But now all my shortcuts are intercepted. IE, CTRL+C will kill my SSH session rather than forwarding SIGINT to the process. Any suggestions?