Describe the bug
When we are ssh into a nerves device, we use Toolshed's exit function to close our ssh connection. The problem is that unlike a normal ssh session closing, closing nerves ssh session looks like an error to our bash shell. E.g. normally when you do ssh remote.server and exit afterwards, if you check echo $? you get 0. But with ssh nerves.local when you give command exit and check with echo $? you get 255. This is the same error code you get if you failed to ssh into nerves device, thus making it impossible for a script to tell whether it failed to make connection with a nerves device or it made a connection and ran everything successfully.
To Reproduce
Overview: ssh into a nerves device and exit, next check the command's status with echo $?. You can follow the commands as:
Expected behavior
Overview: When we exit from nerves ssh, output of echo $? should be 0. If ssh nerves.local command fails the output of
echo $? should be 255.
SFTP with nerves works fine so if anyone wants to check that to confirm he can:
sftp nerves.local
ls
exit
$ echo $?
0