summaryrefslogtreecommitdiffstats
path: root/Functions/Zftp/zfinit
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-15 21:33:36 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-15 21:33:36 +0000
commitce9d10e465acd5a5641778154d176fd737d47eed (patch)
tree4a82590f469b3eae8ffb3ab1d027406d6bad3f9e /Functions/Zftp/zfinit
parentmanual:9047 (diff)
downloadzsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.gz
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.bz2
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.lz
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.xz
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.tar.zst
zsh-ce9d10e465acd5a5641778154d176fd737d47eed.zip
zsh-workers/9067
Diffstat (limited to 'Functions/Zftp/zfinit')
-rw-r--r--Functions/Zftp/zfinit19
1 files changed, 15 insertions, 4 deletions
diff --git a/Functions/Zftp/zfinit b/Functions/Zftp/zfinit
index 256ef1d2f..7179b5e3e 100644
--- a/Functions/Zftp/zfinit
+++ b/Functions/Zftp/zfinit
@@ -1,10 +1,19 @@
emulate -L zsh
-[[ $1 = -n ]] || zmodload -e zftp || zmodload -ia zftp
+[[ $1 = -n ]] || zmodload -e zftp || zmodload -ia zftp || return 1
+
+if zmodload -i zutil; then
+ local arr
+ # Set defaults for styles if none set.
+ zstyle -g arr ':zftp:*' progress || zstyle ':zftp:*' progress bar
+ zstyle -g arr ':zftp:*' update || zstyle ':zftp:*' update 1
+ zstyle -g arr ':zftp:*' titlebar || zstyle ':zftp:*' titlebar true
+ if functions chpwd >&/dev/null && ! zstyle -g arr ':zftp:*' chpwd; then
+ zstyle ':zftp:*' chpwd true
+ fi
-if [[ ${+zfconfig} = 0 ]]; then
typeset -gA zfconfig
- zfconfig=(progress bar update 1 lastsession default)
+ zfconfig=(lastsession default)
fi
alias zfcd='noglob zfcd'
@@ -22,7 +31,7 @@ autoload -U zfstat zftp_chpwd zftp_progress zftransfer zftype zfuget zfuput
# zftp completions: only use these if new-style completion is not
# active.
#
-if [[ ${#_patcomps} -eq 0 || ${_patcomps[(i)zf*]} -gt ${#_patcomps} ]]; then
+if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(i)zf*]} ]]; then
# only way of getting that noglob out of the way: this is unnecessary with
# widget-based completion
setopt completealiases
@@ -55,3 +64,5 @@ if [[ ${#_patcomps} -eq 0 || ${_patcomps[(i)zf*]} -gt ${#_patcomps} ]]; then
compctl -s '$(zftp session)' -S : -x 'C[0,*:*]' \
-K zftransfer_match -- zftransfer
fi
+
+return 0