-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add support for custom app_id for window managers #25349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added an `app_id` field to `App`, allowing users to specify a custom app_id via the new `--app_id` command-line argument. The `build_window_options` function now uses `cx.app_id`, defaulting to the release channel app ID if none is provided. The app ID is initialized in `main.rs` Signed-off-by: Marko Kungla <[email protected]>
We require contributors to sign our Contributor License Agreement, and we don't have @mkungla 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! |
b0ad96e
to
b2dbe2b
Compare
Thank you for the contribution, we actually do support multi-root workspaces via the |
Hi @mikayla-maki, thanks for reviewing my PR! I totally get that Zed supports multi-root workspaces via The This ties into issues like #9459 and #15120, where users want more control over workspace boundaries - #9459 (89 upvotes) calls for A few questions to dig deeper:
I’m really impressed by Zed’s potential - it’s incredible work - and I’d love to refine this if it’s valuable. Happy to adjust the PR or brainstorm alternatives based on your feedback. Thanks again! :) |
I see the kind of feature you're imagining building too, but I don't think that changing the app ID is a good way to do it for 2 reasons:
|
Hey @mikayla-maki, thanks for the feedback—glad the idea’s clicking! I see the App ID concern, but I think it’s more portable than it looks. It’s not really GNOME-specific |
@mkungla That's not how Zed's database is selected. You can see here: Line 143 in 4453fc4
That we generate the database name via release channel, and then use XDG_DATA_HOME to get the directory for it: First via Line 125 in 4453fc4
Which in turn calls Line 48 in 4453fc4
Perhaps you could use something like |
@mikayla-maki, thanks for breaking down the DB logic - really clarifies things! I see how Zed ties the DB name to the release channel (e.g., |
I think we can do an approach similar to VSCode’s —use-data-dir CLI option for this use case. That way we’re not messing with the app id, and are covering all of the data we use in directories, while still hitting your use case :) |
…_dir (#26886) This PR introduces support for a `--user-data-dir` CLI flag to override Zed's data directory and proposes renaming `support_dir` to `data_dir` for better cross-platform clarity. It builds on the discussion in #25349 about custom data directories, aiming to provide a flexible cross-platform solution. ### Changes The PR is split into two commits: 1. **[feat(cli): add --user-data-dir to override data directory](https://github.com/zed-industries/zed/pull/26886/commits/28e8889105847401e783d1739722d0998459fe5a)** 2. **[refactor(paths): rename support_dir to data_dir for cross-platform clarity](https://github.com/zed-industries/zed/pull/26886/commits/affd2fc606b39af1b25432a688a9006229a8fc3a)** ### Context Inspired by the need for custom data directories discussed in #25349, this PR provides an immediate implementation in the first commit, while the second commit suggests a naming improvement for broader appeal. @mikayla-maki, I’d appreciate your feedback, especially on the rename proposal, given your involvement in the original discussion! ### Testing - `cargo build ` - `./target/debug/zed --user-data-dir ~/custom-data-dir` Release Notes: - Added --user-data-dir CLI flag --------- Signed-off-by: Marko Kungla <[email protected]>
…_dir (#26886) This PR introduces support for a `--user-data-dir` CLI flag to override Zed's data directory and proposes renaming `support_dir` to `data_dir` for better cross-platform clarity. It builds on the discussion in #25349 about custom data directories, aiming to provide a flexible cross-platform solution. ### Changes The PR is split into two commits: 1. **[feat(cli): add --user-data-dir to override data directory](https://github.com/zed-industries/zed/pull/26886/commits/28e8889105847401e783d1739722d0998459fe5a)** 2. **[refactor(paths): rename support_dir to data_dir for cross-platform clarity](https://github.com/zed-industries/zed/pull/26886/commits/affd2fc606b39af1b25432a688a9006229a8fc3a)** ### Context Inspired by the need for custom data directories discussed in #25349, this PR provides an immediate implementation in the first commit, while the second commit suggests a naming improvement for broader appeal. @mikayla-maki, I’d appreciate your feedback, especially on the rename proposal, given your involvement in the original discussion! ### Testing - `cargo build ` - `./target/debug/zed --user-data-dir ~/custom-data-dir` Release Notes: - Added --user-data-dir CLI flag --------- Signed-off-by: Marko Kungla <[email protected]>
This PR adds an
app_id
field toApp
, allowing users to set a custom app ID via the new--app-id
command-line argument.build_window_options
now usescx.app_id
, defaulting to the release channel app ID if none is provided.Why?
While there are other potential use cases for a custom
app_id
, I personally use this to make it easier to manage multiple org/project workspaces. Zed’s concepts of Workspaces and Projects can be a bit confusing, and support for multi-root workspaces is currently missing (see issues #9459, #15120, and likely others). There's also no way to open a workspace by ID from workspaces table indb.sqlite
.Instead of making big or breaking changes, this PR introduces a minimal but useful tweak to help mitigate the lack of more advanced workspace support.
For example, having follwing project structure :
Then, using a custom
.desktop
entry, you can assign a uniqueapp_id
so that window managers group all projects from the same org together. This doesn’t fully solve the problem of managing complex/multi-root workspaces, but it does provide a small quality-of-life improvement when dealing with massive org codebases.Example
dev.zed.Zed-Org1.desktop
entryRelease Notes: