cli: Use Terminal Panel's window for zed --add#45073
cli: Use Terminal Panel's window for zed --add#45073SomeoneToIgnore merged 4 commits intozed-industries:mainfrom
zed --add#45073Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @cglwn on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
59f3fc6 to
e6ce28e
Compare
|
Not obvious to me why the Clippy is failing on unrelated files, I didn't run Clippy locally but I'll take a look and update this PR! |
|
I think this is caused by stale PR merge, you need to rebase onto fresh |
|
Hmm, I was only six behind but I'll give that a shot! Did a Sync Fork on my fork which auto merged in Edit: It passed so this should be good to review now :) |
|
Did more testing and for an existing file that exists in another workspace belonging to a different window this makes it open in the window When run from an external terminal (i.e. not in Zed), it opens in the window that has the workspace containing the file. |
zed --addzed --add
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Nice, thank you for the test specifically.
f9ca019 to
b241260
Compare
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 Generated with script/docs-suggest-publish for human review in draft PR.
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
Auto-applied documentation from: - PR #48908: git diff view toggle + default setting - PR #48909: agent mode cycling keybinding - PR #48910: diff view nomenclature standardization - PR #48912: split diff for everyone - PR #48930: terminal welcome screen fix - PR #44794: JSON/YAML schema paths - PR #48763: Python environments in REPL - PR #45073: zed --add terminal panels - PR #48495: Python Windows path handling - PR #49374: type on search default
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
Auto-applied documentation from: - PR #48908: git diff view toggle + default setting - PR #48909: agent mode cycling keybinding - PR #48910: diff view nomenclature standardization - PR #48912: split diff for everyone - PR #48930: terminal welcome screen fix - PR #44794: JSON/YAML schema paths - PR #48763: Python environments in REPL - PR #45073: zed --add terminal panels - PR #48495: Python Windows path handling - PR #49374: type on search default
This makes the
zed --add <PATH>command use the window it was run from when run from a Terminal Panel. I run into this paper cut quite a lot working with multiple projects and preferring to create new files through the CLI instead of the GUI.Before
With two windows open, running
zed --add a.txtin one window's terminal might open the filea.txtin the other window.Screencast.from.12-17-2025.02.24.45.AM.-.zed.--add.bug.before.webm
After
With this change, it will use the window of the Terminal Panel.
Screencast.from.12-17-2025.02.16.09.AM.-.zed.--add.bug.after.webm
Release Notes:
zed --addcommand to prefer window it was run from