diff --git a/docs/quick-start.md b/docs/quick-start.md index 8cd40942..85771b91 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -116,6 +116,23 @@ if not "%cwd%"=="" ( ) del "%tmpfile%" +``` + + + + +```xonsh +def _y(args): + tmp = $(mktemp -t "yazi-cwd.XXXXXX") + args.append(f"--cwd-file={tmp}") + $[yazi @(args)] + with open(tmp) as f: + cwd = f.read().strip() + if cwd != $PWD: + cd @(cwd) + rm -f -- @(tmp) + +aliases["y"] = _y ```