Skip to content

Canonicalize --user-data-dir path to match file watcher events#48470

Merged
dinocosta merged 1 commit intomainfrom
improve-user-data-dir
Feb 6, 2026
Merged

Canonicalize --user-data-dir path to match file watcher events#48470
dinocosta merged 1 commit intomainfrom
improve-user-data-dir

Conversation

@dinocosta
Copy link
Member

This commit updates the paths::set_custom_data_dir implementation so as to always canonicalize the provided dir, even when dealing with an absolute path.

This ensures that we correctly deal with symlinks and don't end up not reacting to filesystem watcher events in this specific case. For example, when using --user-data-dir /tmp/zed on macOS, since /tmp is a symlink to /private/tmp, if any setting was changed, the application would not react, as the event would be using
/private/tmp/zed/config/settings.json, while the watcher would be looking out for /tmp/zed/config/settings.json.

Lastly, the canonicalization of the path is now done after std::fs::create_dir_all is called, in order to guarantee that the directory already exists at that point.

Release Notes:

  • N/A

This commit updates the `paths::set_custom_data_dir` implementation so
as to always canonicalize the provided `dir`, even when dealing with an
absolute path.

This ensures that we correctly deal with symlinks and don't end up not
reacting to filesystem watcher events in this specific case. For
example, when using `--user-data-dir /tmp/zed` on macOS, since `/tmp` is
a symlink to `/private/tmp`, if any setting was changed, the application
would not react, as the event would be using
`/private/tmp/zed/config/settings.json`, while the watcher would be
looking out for `/tmp/zed/config/settings.json`.

Lastly, the canonicalization of the path is now done after
`std::fs::create_dir_all` is called, in order to guarantee that the
directory already exists at that point.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 5, 2026
@dinocosta dinocosta changed the title Canonicalize --user-data-dir path to match file watching Canonicalize --user-data-dir path to match file watcher events Feb 5, 2026
@zelenenka zelenenka added the staff Pull requests authored by a current member of Zed staff label Feb 6, 2026
@dinocosta dinocosta merged commit 7377cb6 into main Feb 6, 2026
36 checks passed
@dinocosta dinocosta deleted the improve-user-data-dir branch February 6, 2026 15:10
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- LSP folding ranges support (zed-industries#48611) - textDocument/foldingRange with custom fold text
- LSP refactoring (zed-industries#48604) - extracted document_colors, code_lens, folding_ranges into modules
- Crate graph restructuring (zed-industries#48602) - terminal moved closer to editor
- Side-by-side diff searching (zed-industries#48539) and OpenExcerpts for LHS (zed-industries#48438)
- SplittableEditor: sync custom blocks between RHS/LHS (zed-industries#48575)
- Thinking effort for Zed/OpenAI providers (zed-industries#48545, zed-industries#48605)
- Agent default_model.enable_thinking setting (zed-industries#48536)
- Configurable LSP timeout setting (zed-industries#44745)
- PaneSearchBarCallbacks global (search bar setup extracted from vim)
- Settings migrations for nested platform/channel/profile keys (zed-industries#48550)
- Shell parser: I/O redirects, here-documents, compound commands (zed-industries#48635)
- Hardened tool authorization: sensitive settings, deferred ops (zed-industries#48641)
- rm security bypass fixes (zed-industries#48640, zed-industries#48647)
- MCP tool name parsing fix: newline delimiter (zed-industries#48636)
- Canonicalize --user-data-dir path (zed-industries#48470)
- Fix text_threads_dir XDG spec compliance (zed-industries#45771)
- Buffer font for folds (zed-industries#48652)
- Multibuffer toolbar layout shift fix (zed-industries#48472)
- Editor: tabs bitmask syncing (zed-industries#48366)

Conflict resolution:
- collab tests: deleted (collab removed)
- util/archive.rs, util/shell.rs: deleted (extracted to Obsydian)
- copilot_ui/sign_in.rs: kept native_button style
- editor_tests.rs: merged imports (kept MoveItemToPaneInDirection, added ViewId/FollowEvent)
- lsp_store.rs: took upstream refactored imports, added FoldingRangeData, removed collab imports
- main.rs: added PaneSearchBarCallbacks, removed vim::init

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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 staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants