better support for fresh headless servers

This commit is contained in:
wooshings
2026-03-24 11:14:52 -07:00
parent cbc77f627f
commit 6d7b4cf0b1
4 changed files with 19 additions and 4 deletions
+5 -1
View File
@@ -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