TIL: You can use `echo $?` to get the last process's exit code.
this is actually the most useful thing to put in your prompt (much more than your username, the current directory and other redundant stuff), as in PS1='$?\$ '
Might be useful but I just spent half an hour trying everything at
https://stackoverflow.com/questions/16715103/bash-prompt-wit... on a MacBook Pro and none of it worked.