aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--profile.dot.link11
1 files changed, 10 insertions, 1 deletions
diff --git a/profile.dot.link b/profile.dot.link
index 4bb131a..e5f280b 100644
--- a/profile.dot.link
+++ b/profile.dot.link
@@ -31,7 +31,7 @@ export PATH=$PATH
# See http://www.caliban.org/bash/#bashtips
export CDPATH=".:~:~/code:~/data:~/file:~/apps:/var/www/data"
-# See http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd
+# Based on http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd
cd() {
if [ -z "$*" ]; then
destination=~
@@ -39,7 +39,16 @@ cd() {
destination=$*
fi
+ # Check if its a project under CPATH
+ project=`command cd "${destination}" 2> /dev/null`
+
+ # Got to folder
command cd "${destination}" > /dev/null
+
+ # Update screen title
+ if [ ! -z "$project" ] && [ ! -z "$STY" ]; then
+ stitle `basename $project`
+ fi
}
# Default editor