You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
I seem to have figured out a way to do it. It's by no means a pretty solution, but basically, requestShell returns a stream that you can connect just like in the example here: mscdex/ssh2#718 (comment)
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 thessh
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 thatnode-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 withSSH2
and wrap it in promises, which could possibly be incorporated innode-ssh
.The text was updated successfully, but these errors were encountered: