diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-25 15:43:41 +0000 |
commit | 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (patch) | |
tree | ff703cbc295605f90755edb68672ed2de11f4a81 /Functions/Zftp/zftp_chpwd | |
parent | 8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 (diff) | |
download | zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.gz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.xz zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.zip |
zsh-3.1.5-pws-16 zsh-3.1.5-pws-16-w6109 dot-zsh-199904280524
Diffstat (limited to 'Functions/Zftp/zftp_chpwd')
-rw-r--r-- | Functions/Zftp/zftp_chpwd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Functions/Zftp/zftp_chpwd b/Functions/Zftp/zftp_chpwd new file mode 100644 index 000000000..0df199cfb --- /dev/null +++ b/Functions/Zftp/zftp_chpwd @@ -0,0 +1,39 @@ +# function zftp_chpwd { +# You may want to alter chpwd to call this when $ZFTP_USER is set. + +# Cancel the filename cache for the current directory. +zftp_fcache=() +# ...and also empty the stored directory listing cache. +# As this function is called when we close the connection, this +# is the only place we need to do these two things. +[[ -n $zfcurdir && -f $zfcurdir ]] && rm -f $zfcurdir +zfotherargs= + +if [[ -z $ZFTP_USER ]]; then + # last call, after an FTP logout + + # delete the non-current cached directory + [[ -n $zfotherdir && -f $zfotherdir ]] && rm -f $zfotherdir + + # don't keep zflastdir between opens (do keep zflastsession) + zflastdir= + + # return the display to standard + # uncomment the following line if you have a chpwd which shows directories + # chpwd +else + [[ -n $ZFTP_PWD ]] && zflastdir=$ZFTP_PWD + zflastsession="$ZFTP_HOST:$ZFTP_PWD" + local args + if [[ -t 1 && -t 2 ]]; then + local str=$zflastsession + [[ ${#str} -lt 70 ]] && str="%m: %~ $str" + case $TERM in + sun-cmd) print -n -P "\033]l$str\033\\" + ;; + xterm) print -n -P "\033]2;$str\a" + ;; + esac + fi +fi +# } |