Cd : Yazi cd to dir on exit.
This commit is contained in:
parent
416f49ed18
commit
2890c81cef
|
@ -45,7 +45,12 @@
|
||||||
|
|
||||||
# CLI cd. Opens CLI file manager.
|
# CLI cd. Opens CLI file manager.
|
||||||
function ccd() {
|
function ccd() {
|
||||||
yazi
|
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||||
|
yazi "$@" --cwd-file="$tmp"
|
||||||
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
|
cd -- "$cwd"
|
||||||
|
fi
|
||||||
|
rm -f -- "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get list of all parent dirs.
|
# Get list of all parent dirs.
|
||||||
|
|
Loading…
Reference in a new issue