aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-14 18:44:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-14 18:44:08 +1200
commitc09dc6c3ae6e3ab6e385bf2ae4bcba6bd733b734 (patch)
tree0ca52d3b87b0e482961e7e57fbffb3c8757858e3 /bash
parentUnset PROMPT_COMMAND rather than blanking it (diff)
downloaddotfiles-c09dc6c3ae6e3ab6e385bf2ae4bcba6bd733b734.tar.gz
dotfiles-c09dc6c3ae6e3ab6e385bf2ae4bcba6bd733b734.zip
Use PROMPT_DIRTRIM if available
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash5
1 files changed, 5 insertions, 0 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index da8262ad..c4293aae 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -10,6 +10,11 @@ prompt() {
PROMPT_COMMAND='ret=$? ; history -a'
PS1='\[\a\][\u@\h:\w]$(prompt vcs)$(prompt job)$(prompt ret)\$'
+ # If Bash 4.0 is available, trim very long paths in prompt
+ if ((${BASH_VERSINFO[0]} >= 4)); then
+ PROMPT_DIRTRIM=4
+ fi
+
# Count available colors, reset, and format (decided shortly)
local colors=$(tput colors)
local reset=$(tput sgr0)