diff options
-rw-r--r-- | cdlog.sh | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -157,6 +157,7 @@ cdlog.chdir() { local cur=$PWD local def + local print= declare -n d=cdlog_hist if [ $# -eq 2 -a "$1" = -P ] ; then @@ -165,11 +166,13 @@ cdlog.chdir() ;; ( [1-9] ) set -- -P "${d[$2]}" + print=y ;; ( ?* ) def=${cdlog_alias[$2]} if [ -n "$def" ] ; then - set -- -P "$def" + set -- -P "$def" + print=y fi ;; ( * ) @@ -181,6 +184,7 @@ cdlog.chdir() if command cd "$@" && [ "$PWD" != "$cur" ]; then # only if we successfully change to a different # directory do the following + [ $print ] && printf "%s\n" "$PWD" if [ $cdlog_lru ] ; then local nx= |