server-init/lf-snippet.sh

17 lines
337 B
Bash
Raw Normal View History

2023-02-12 12:44:53 +00:00
## Exit on working directory for lf
lf () {
tmp="$(mktemp)"
_lf -last-dir-path="$tmp" "$@" --command "set hidden"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
if [ -d "$dir" ]; then
if [ "$dir" != "$(pwd)" ]; then
cd "$dir"
fi
fi
fi
}