Skip to content

editor: Fix open_url command not handling non-channel server URLs#44293

Closed
NimitzDEV wants to merge 3 commits intozed-industries:mainfrom
NimitzDEV:main
Closed

editor: Fix open_url command not handling non-channel server URLs#44293
NimitzDEV wants to merge 3 commits intozed-industries:mainfrom
NimitzDEV:main

Conversation

@NimitzDEV
Copy link

Closes #43833

Fix open_url to handle all server URLs, not just channel links

Previously, URLs like zed.dev/docs or zed.dev/extensions, or any URL that matches the server_url setting but does not link to a collab channel, were rejected instead of being opened in the browser because parse_request_path threw errors when links were not channel links.

Release Notes:

  • editor: Fix open_url command not handling non-channel server URLs

@cla-bot
Copy link

cla-bot bot commented Dec 6, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @NimitzDEV 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'.

@NimitzDEV
Copy link
Author

@cla-bot check

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

cla-bot bot commented Dec 6, 2025

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

@ConradIrwin
Copy link
Member

@NimitzDEV Thanks for this! We shouldn't add a regex, but we should update the code so that if we fail to parse it using the existing functions we fallback to opening the browser.

That might require shuffling some code around.

@NimitzDEV
Copy link
Author

@ConradIrwin Hi, Thanks for the feedback! I updated the fix to avoid using regex as suggested. OpenRequest::parse now handles the fallback to the user's browser for unhandled URLs. Let me know if this is the better way to implement the fix.

Also, while working on this, I noticed a potential issue in the parse function. It can take multiple URLs but only last one can be handled, because this.kind gets overwritten in each iteration. Not sure if this is intended.

@ConradIrwin
Copy link
Member

Thanks for taking the time to make this better!

As I was reviewing this change, I realized that we didn't want to run the risk of overloading the open url request (because then we might end up redirecting back and forth between the web and the editor), so I spent a bit of time playing, and ended up with the change in #44910 instead.

@github-project-automation github-project-automation bot moved this from In progress to Done in Quality Week – December 2025 Dec 15, 2025
ConradIrwin added a commit that referenced this pull request Dec 16, 2025
- **Fix editor::OpenUrl on zed links**
- **Fix cmd-clicking links too**

Closes #44293
Closes #43833

Release Notes:

- The `editor::OpenUrl` action now works for links to https://zed.dev
- Clicking on a link to a Zed channel or channel-note within the editor
no-longer redirects you via the web.

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
- **Fix editor::OpenUrl on zed links**
- **Fix cmd-clicking links too**

Closes zed-industries#44293
Closes zed-industries#43833

Release Notes:

- The `editor::OpenUrl` action now works for links to https://zed.dev
- Clicking on a link to a Zed channel or channel-note within the editor
no-longer redirects you via the web.

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
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

Development

Successfully merging this pull request may close these issues.

editor: open url does not work with domain zed.dev

2 participants