| name | open-in-zed |
|---|---|
| description | Open a directory in a brand-new Zed window. No argument opens the current worktree (pwd). An argument is treated as a path, or as a bare worktree name resolved under ~/Developer/paloma/wt/. Use when the user says "open in zed", "open this in a new zed window", or "zed <worktree-name>". |
Open a directory in a new Zed window using zed -n (forces a fresh workspace, never reuses or tabs into an existing window).
- No argument → target is
$PWD(the worktree you're currently in). - Argument contains a
/or starts with~/.→ treat it as a path. Expand~and resolve to an absolute path. - Bare argument (no slash), e.g.
laughing-mestorf-5e2cd2→ it's a worktree name. Resolve it:Ifmatch=$(ls -d ~/Developer/paloma/wt/*/"$ARG" 2>/dev/null | head -1)$matchis non-empty, that's the target. If not, fall back to treating the argument as a literal path.
If the resolved target doesn't exist as a directory, stop and tell the user — don't launch Zed on a missing path.
zed -n "$TARGET"That's it. Confirm what you opened (the resolved absolute path), nothing more.