Skip to content

cli: Use Terminal Panel's window for zed --add#45073

Merged
SomeoneToIgnore merged 4 commits intozed-industries:mainfrom
cglwn:use-terminal-panel-window
Feb 12, 2026
Merged

cli: Use Terminal Panel's window for zed --add#45073
SomeoneToIgnore merged 4 commits intozed-industries:mainfrom
cglwn:use-terminal-panel-window

Conversation

@cglwn
Copy link
Contributor

@cglwn cglwn commented Dec 17, 2025

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.txt in one window's terminal might open the file a.txt in 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:

  • Improved zed --add command to prefer window it was run from

@cla-bot
Copy link

cla-bot bot commented Dec 17, 2025

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'.

@cglwn
Copy link
Contributor Author

cglwn commented Dec 17, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 17, 2025
@cla-bot
Copy link

cla-bot bot commented Dec 17, 2025

The cla-bot has been summoned, and re-checked this pull request!

@cglwn cglwn force-pushed the use-terminal-panel-window branch from 59f3fc6 to e6ce28e Compare December 17, 2025 08:09
@cglwn
Copy link
Contributor Author

cglwn commented Dec 17, 2025

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!

@SomeoneToIgnore
Copy link
Contributor

I think this is caused by stale PR merge, you need to rebase onto fresh main.

@cglwn
Copy link
Contributor Author

cglwn commented Dec 17, 2025

Hmm, I was only six behind but I'll give that a shot! Did a Sync Fork on my fork which auto merged in main. Will leave for now to see if it passes and can clean up history if needed.

Edit: It passed so this should be good to review now :)

@cglwn
Copy link
Contributor Author

cglwn commented Dec 17, 2025

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 zed --add was run from too which I think makes sense.

When run from an external terminal (i.e. not in Zed), it opens in the window that has the workspace containing the file.

@cglwn cglwn changed the title Use Terminal Panel's window for zed --add cli: Use Terminal Panel's window for zed --add Dec 18, 2025
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you for the test specifically.

@SomeoneToIgnore SomeoneToIgnore enabled auto-merge (squash) February 12, 2026 10:12
@SomeoneToIgnore SomeoneToIgnore force-pushed the use-terminal-panel-window branch from f9ca019 to b241260 Compare February 12, 2026 10:24
@SomeoneToIgnore SomeoneToIgnore merged commit b9c1970 into zed-industries:main Feb 12, 2026
27 checks passed
morgankrey added a commit that referenced this pull request Feb 19, 2026
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.
morgankrey added a commit that referenced this pull request Feb 25, 2026
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.
morgankrey added a commit that referenced this pull request Feb 25, 2026
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
morgankrey added a commit that referenced this pull request Feb 25, 2026
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.
morgankrey added a commit that referenced this pull request Feb 25, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants