better support for fresh headless servers
This commit is contained in:
+5
-1
@@ -8,7 +8,11 @@ eval "$(starship init zsh)"
|
||||
|
||||
function yy() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if command -v yazi &>/dev/null; then
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
else
|
||||
nvim .
|
||||
fi
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user