Open EvanCarroll opened 3 years ago
You can workaround it with a wrapper like a bash script that runs your command, then inspects $?
. You can print it to stderr to see it as diagnostic in console where Websocat is running or output it to stdout for it to be delivered as a WebSocket message.
If you are going to create a wrapper program or script for #112, exit code handling should also go to that wrapper.
I'm not sure Websocat should have full flexibility with arguments, environment variables, exit codes, working directories, users, etc. Websocat does not try to be /bin/bash
. If something can efficiently be done with wrappers, it should probably be done with wrappers instead.
Exit-code-specific Websocat features may include logging the exit code in debug logs or maybe deliberately aborting WebSocket connection (instead of cleanly exiting it) in case of nonzero code.
It would be great if we got a message that provided the error/exit code that the program returned with.