Skip to content

Pseudo-TTY allocation? #480

@codiophile

Description

@codiophile

For transparency, I have a service that starts long running commands over SSH, and I want it to be able to resume those SSH sessions after a restart. I thought I would be able to do it using screen/tmux, but they both complain about the lack of a terminal. I read about it, and when using the ssh command, the -t flag will force a pseudo-tty to be allocated, which enables you to run screen based programs.

Fortunately, I've found some evidence that this should be possible to do with SSH2:
mscdex/ssh2#718 (comment)
mscdex/ssh2#769 (comment)

Unfortunately, I have no idea how that translates to node-ssh. It also looks fairly complicated and involves writing directly to streams and listening to events. Considering that node-ssh is a thin wrapper, I wouldn't be surprised if it exposes the necessary APIs, but you'd probably still have to write to streams and listen to events to make it work.

I think this issue should primarily be considered a feature request for a neat API to execute commands with a pseudo-tty. I would greatly appreciate if you could correct me, if any of my assumptions are wrong. I'm assuming that at the time of writing, I'm better off using SSH2 directly for accomplishing this. I'm fairly likely to attempt to implement this with SSH2 and wrap it in promises, which could possibly be incorporated in node-ssh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions