diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-09-24 07:18:57 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-09-24 07:18:57 +0300 |
commit | 4ed0b279ef8372c12d69328afd4f9cd1702213c3 (patch) | |
tree | b7b238ccecfaa1896727ab2505f5e83ad3bd368c /bashrc | |
parent | 9e2cf325a896f000af51491c835ee339b9784547 (diff) | |
download | liw-dot-files-4ed0b279ef8372c12d69328afd4f9cd1702213c3.tar.gz |
fix(bashrc): setting of PROMPT_COMMAND
This is getting silly. I should just make sure I have zoxide and
starship installed everywhere.
Sponsored-by: author
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -193,14 +193,16 @@ if [ -n "$PS1" ]; then bind -r '' fi -export PROMPT_COMMAND=prompt_set_window_title - -if command -v zoxide > /dev/null; then - eval "$(zoxide init bash)" -fi +gotcmd() { + command -v "$1" > /dev/null +} -if command -v starship > /dev/null; then - eval "$(starship init bash)" +if gotcmd zoxide && gotcmd starship; then + export PROMPT_COMMAND=prompt_set_window_title + eval "$(zoxide init bash)" + eval "$(starship init bash)" +else + export PROMPT_COMMAND=prompt_command fi if [ -e "$HOME/.cargo/env" ] |