How to change current directory of shell to selected directory in yazi upon exiting? #1034
Replies: 5 comments 4 replies
|
Hm, it should just work. Unfortunately, the suggestions I can think of are very basic. Like, making sure you:
edit: improve the clarity |
0 replies
|
i am using zsh (in function yy() {
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"
}
Calling |
3 replies
|
It doesnt work for me neither. I have copied the same from Quickstart and added to my zshrc |
0 replies
|
@sxyazi |
0 replies
|
If anyone's looking for a version that works in fish: function yy
set -l tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file=$tmp
set cwd (cat -- $tmp)
if test -s $tmp
if test -n "$cwd" -a "$cwd" != "$PWD"
cd -- $cwd
commandline -f repaint # updates the prompt
end
end
rm -f -- $tmp
endEdit: added line to update the prompt |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I've tried the function that is given on the website quick start:
but that doesn't seem to work when I use
qorQto exit the explorer. Is there something else that I should be doing to make this work?All reactions