5 ms·
PROMPT_COMMAND ( is one of the powerful ones. I have modified my own to log the commands into timestamped based log files.
by nishparadox 7y ago
PROMPT_COMMAND ( is one of the powerful ones. I have modified my own to log the commands into timestamped based log files.
- noisy_boy 7y agoSetting it to show git branch information is another common use.
- DonaldPShimoda 7y agoI use it for printing the full cwd in my prompt (instead of the usual one abridged with tilde), as well as git branch info.
- Pawamoy 7y agoI use it in combination with a trap on DEBUG signal to compute information about each interactive command (start/stop timestamps, type, working dir, return code, and more) and save it in a big log file. I can then transform the data into pretty charts! It's also used by the `z` command line tool to maintain its directory "frecency" list.