diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-01 12:05:33 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-01 12:05:33 -0300 |
commit | 7d222b2f6321b49c04a617a36c5dc694eddd5067 (patch) | |
tree | 63941ad580c2991f8aaf029759a09c224239f51a /profile.dot.link | |
parent | 2eb80be0fe39516a5625d168524dc92ae5b407ce (diff) | |
download | profile-7d222b2f6321b49c04a617a36c5dc694eddd5067.tar.gz profile-7d222b2f6321b49c04a617a36c5dc694eddd5067.tar.bz2 |
Enhanced cd builtin
Diffstat (limited to 'profile.dot.link')
-rw-r--r-- | profile.dot.link | 11 |
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 |