2 ms·
Might be useful but I just spent half an hour trying everything at https://stackoverflow.com/questions/16715103/bash-prompt-with-last-exit-code https://stackove
by Noumenon72 6y ago
Might be useful but I just spent half an hour trying everything at https://stackoverflow.com/questions/16715103/bash-prompt-with-last-exit-code https://stackoverflow.com/questions/16715103/bash-prompt-wit... on a MacBook Pro and none of it worked.
- LeoPanthera 6y agoMaybe you are not using bash. echo $SHELL to find out.
- JdeBP 6y agoThat's because, as a MacOS user, you are probably using the Z shell, not the Bourne Again shell. Prompt syntax is specific to each individual shell program. One cannot just blindly use a Stack Exchange Q&A that states that it is for "Linux" and "bash" on the Z shell on MacOS, or indeed on the Z shell on a Linux-based operating system for that matter. Or in the C shell. Or in the Korn shell. Or in the Watanabe shell.