diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 18:10:59 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-10-04 18:10:59 +0200 |
| commit | 6313738906f760f8a9b73cfe18dc2593bee1b4c5 (patch) | |
| tree | 6f07e3d62dfb992fe737d574a1132eadfd640b35 /.bash_prompt | |
| parent | b15a51d3f2be594f648baf62aeda0c442cdd1784 (diff) | |
| download | dotfiles-6313738906f760f8a9b73cfe18dc2593bee1b4c5.tar.xz | |
Adjust prompt for M-x shell
Diffstat (limited to '.bash_prompt')
| -rw-r--r-- | .bash_prompt | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/.bash_prompt b/.bash_prompt index 0d7f46b..97297d4 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -238,11 +238,27 @@ __smart-term/init () fi } +__dumb-term/set-ps1 () +{ + local -ir rc=$? + + BUILDING_PS=t + + PS1='' + ((rc)) && PS1+=$(__fontify "${rc} " bold red) + PS1+='\W\$ ' + + unset BUILDING_PS +} + +__dumb-term/init () +{ + PROMPT_COMMAND=__dumb-term/set-ps1 +} + -if [ "${TERM}" = dumb ] -then - PS1='$? \u:\w\$ ' - PS2='> ' -else - __smart-term/init -fi +case "${TERM}" +in + dumb) __dumb-term/init ;; + *) __smart-term/init ;; +esac |
