Files
RedBear-OS/recipes/shells/zsh/source/Functions/Zftp/zftp_chpwd
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

43 lines
1.4 KiB
Plaintext

# function zftp_chpwd {
# You may want to alter chpwd to call this when $ZFTP_USER is set.
# If the directory really changed...
if [[ $ZFTP_PWD != $zfconfig[lastdir_$ZFTP_SESSION] ]]; then
# ...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.
local curdir=$zfconfig[curdir_$ZFTP_SESSION]
[[ -n $curdir && -f $curdir ]] && rm -f $curdir
zfconfig[otherargs_$ZFTP_SESSION]=
zffcache -d
fi
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 lastdir between opens (do keep lastloc)
zfconfig[lastdir_$ZFTP_SESSION]=
# return the display to standard
zstyle -t ":zftp$curcontext" chpwd && chpwd
else
[[ -n $ZFTP_PWD ]] && zfconfig[lastdir_$ZFTP_SESSION]=$ZFTP_PWD
zfconfig[lastloc_$ZFTP_SESSION]="$ZFTP_HOST:$ZFTP_PWD"
zfconfig[lastuser_$ZFTP_SESSION]="$ZFTP_USER"
local args
if [[ -t 1 && -t 2 ]] && zstyle -t ":zftp$curcontext" titlebar; then
local str=$zfconfig[lastloc_$ZFTP_SESSION]
[[ ${#str} -lt 70 ]] && str="%m: %~ $str"
case $TERM in
sun-cmd) print -Pn "\033]l$str\033\\"
;;
*xterm*|rxvt|dtterm|Eterm|kterm) print -Pn "\033]2;$str\a"
;;
esac
fi
fi
# }