diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-10 13:57:31 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-10 13:57:31 +0000 |
commit | b67e4abb100f67ca05809baab37700eb5ee0a342 (patch) | |
tree | f19c7eb1544bd6071e01155825a7aae3cc99117d /Functions/Zftp/zfcd | |
parent | bc3256997b737f6158e9768dcf5738a7c0fbb454 (diff) | |
download | zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.tar.gz zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.tar.xz zsh-b67e4abb100f67ca05809baab37700eb5ee0a342.zip |
manual/7767
Diffstat (limited to 'Functions/Zftp/zfcd')
-rw-r--r-- | Functions/Zftp/zfcd | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Functions/Zftp/zfcd b/Functions/Zftp/zfcd index b726d9f55..2ecc8b0f6 100644 --- a/Functions/Zftp/zfcd +++ b/Functions/Zftp/zfcd @@ -22,9 +22,9 @@ emulate -L zsh if [[ $1 = /* ]]; then - zfautocheck -dn + zfautocheck -dn || return 1 else - zfautocheck -d + zfautocheck -d || return 1 fi if [[ $1 = $HOME || $1 = $HOME/* ]]; then @@ -36,7 +36,7 @@ if (( $# == 0 )); then set -- '~' elif [[ $# -eq 1 && $1 = - ]]; then # Emulate `cd -' behaviour. - set -- $zflastdir + set -- $zfconfig[lastdir_$ZFTP_SESSION] elif [[ $# -eq 2 ]]; then # Emulate `cd old new' behaviour. # We have to find a character not in $1 or $2; ! is a good bet. @@ -47,6 +47,8 @@ fi # if we want to keep it. local lastdir=$ZFTP_PWD -zftp cd "$@" && zflastdir=$lastdir -print $zflastsession +zftp cd "$@" && [[ $lastdir != $ZFTP_PWD ]] && +zfconfig[lastdir_$ZFTP_SESSION]=$lastdir + +print $zfconfig[lastloc_$ZFTP_SESSION] # } |