gliderlabs / cmd

Other
28 stars 4 forks source link

ssh with pty allocation can lead to "short write" #59

Closed euank closed 7 years ago

euank commented 7 years ago
$ ssh -t alpha.cmd.io euank/sl
short write
                                           Connection to alpha.cmd.io closed.

$ ssh -t core@coreos-host docker run -it euank/sl
# no short write, so clearly it's not just a docker or ssh issue

Without the -t it runs for the expected duration of a few minutes.

I don't expect the short write to occur and I believe it's a bug in the cmd.io ssh server's handling of ptys.

progrium commented 7 years ago

Actually I'm unable to reproduce this on alpha.cmd.io now. @euank can you confirm it's reproducible for you? Changes since this issue might have caused a different issue, but this is what I'm getting after installing euank/sl as sl, regardless of forcing a terminal or not:

$ ssh alpha.cmd.io sl
Error opening terminal: unknown.

While running via Docker still seems to work.

@mattaitchison do you get the same?

euank commented 7 years ago

I can still reproduce this, @progrium. You're missing the -t flag for ssh. You might also need to set TERM=xterm depending on your terminal emulator.

mattatcha commented 7 years ago

Running with TERM=xterm gives me the following. The -t flag still errors with a short write though. image

euank commented 7 years ago

Whether it's obvious or not, without -t the output will be incorrect (does that look like a well-formed train?). This is also true for the average ncurses application, and probably other tuis.