With the command sub-protocol (which I'm calling it because I don't remember what it is otherwise called) a client (fabric, ssh, etc) will be told the return code of a command when it finishes executing on the remote machine.
With the shell sub-protocol, you are told the return code of the shell, when the shell session ends. Shell sessions usually end “well” even if all the commands executed through it has failed. Shells also typically wait for more input when they've finished running a command, and they only notify you of this by printing a dynamically configurable string that typically doesn't end with a line break.
That's why tools like fabric prefer to use the command sub-protocol. I don't know of any good work around to this.
Chris |