feat(fish): preserve directory after Yazi exits
Add the standard cwd-file wrapper so Yazi navigation updates the interactive shell directory.
This commit is contained in:
@@ -32,3 +32,13 @@ set --export PATH $BUN_INSTALL/bin $PATH
|
|||||||
|
|
||||||
# opencode
|
# opencode
|
||||||
fish_add_path /home/alex/.opencode/bin
|
fish_add_path /home/alex/.opencode/bin
|
||||||
|
|
||||||
|
# Yazi wrapper that keeps the shell in its selected directory.
|
||||||
|
function y
|
||||||
|
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||||
|
command yazi $argv --cwd-file="$tmp"
|
||||||
|
if read -z cwd <"$tmp"; and [ "$cwd" != "$PWD" ]; and test -d "$cwd"
|
||||||
|
builtin cd -- "$cwd"
|
||||||
|
end
|
||||||
|
command rm -f -- "$tmp"
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user