summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-06-14 20:29:12 +0300
committerLars Wirzenius <liw@liw.fi>2017-01-15 16:11:41 +0200
commit7c93a2569d0ba08b82d50099f874f1b33cea194c (patch)
tree72287ef011e1dfc61b19620c4793291191623b3a /bashrc
parentd177c03765293feb132f09075576303890427836 (diff)
downloadliw-dot-files-7c93a2569d0ba08b82d50099f874f1b33cea194c.tar.gz
Add cwd to PS1
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc10
1 files changed, 9 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index 06ead16..c7ab407 100644
--- a/bashrc
+++ b/bashrc
@@ -66,7 +66,7 @@ prompt_command() {
fi
base="`basename "$PWD"`"
str2xterm "$base - $iconpart$PWD" "$base - $titlepart$PWD"
- PS1="\\[$(start_bold)\\]$debian_chroot\\u@\\h$(git_prompt_part)\\$ \\[$(normal_mode)\\]"
+ PS1="\\[$(start_bold)\\]$debian_chroot\\u@\\h$(git_prompt_part)$(basename_mode)(\w)$(start_bold)\\$ \\[$(normal_mode)\\]"
}
we_have_term()
@@ -74,6 +74,14 @@ we_have_term()
[ "$TERM" ] && [ "$TERM" != dumb ]
}
+basename_mode()
+{
+ if we_have_term
+ then
+ tput dim
+ fi
+}
+
start_error()
{
if we_have_term