in reply to Emulate a terminal to SSH

Expect and IO::Pty come to mind, as possibly does the -t flag to ssh if the tty needs to be allocated on the remote side.

The cake is a lie.
The cake is a lie.
The cake is a lie.