SSH – Do Programs Run from an SSH Session Depend on the Connection?

job-controlsshtty

Does a program that is run from an ssh session depend on the connection to the client? For example when the connection is really slow.
So does it actively wait until things are printed on the screen?

And if it does depend on the connection, does it also happen with screen or byobu for example? Since with these the programs are kept running even after disconnecting from the host.


Note: I only found these related questions:

Best Answer

The output of programs is buffered, so if the connection is slow the program will be halted if the buffer fills up.

If you use screen, it has a buffer as well that it uses to try and display to a connected session. But a program connected in the screen session will not be stopped if screen cannot update the remote terminal fast enough. Just like when a connection is lost, the program continues filling screens buffer until it overflows (pushing out the oldest information). What you see coming in (and can scroll back to) is depending on what is (still) in that buffer. screen effectively discouples your program from your terminal (and your slow SSH connection).

Related Question