0
I wanted to execute a command in a remote shell in its interactive environment, so as to make it load my remote .bash_profile
there first before executing the command.
This works great:
echo "command" | ssh user@remote_host
[1]
But it gives an error
Pseudo-terminal will not be allocated because stdin is not a terminal.
I don't know if this is an issue because the above command works great for my purpose, but still I looked for a solution to make it go away and I found
ssh -t -t
[2]
Combining them you get echo "command" | ssh -tt user@remote_host
which works great.
But for some weird reason on Git bash, after returning from executing the command, I can't type anymore. I tested it on Cygwin where it works great, so it's only Git bash that has this problem.
I tried to type exit
in case it's still invisibly stuck in that remote shell but nothing works.
Any ideas what might be the issue with doing ssh -tt
on Git bash?
Thanks so much for this. I kept getting into this weird state after
git add -i
. Had no idea what was going on. – leesio – 2017-10-25T08:01:33.970