Mac's Terminal comes with a default PROMPT_COMMAND
that checks the history and updates the current working directory (title of the tab):
Add echo $PROMPT_COMMAND
to the top of your .bash_profile
and you'll see:
shell_session_history_check; update_terminal_cwd
I want to add my own PROMPT_COMMAND
without over-writing the default. The default should come before my custom PROMPT_COMMAND
with a semicolon and space to separate the two.
Note that some programs (such as IntelliJ and VS Code) don't have a default! So I wouldn't want to include the space/semicolon in that case.