Auto-reload shell environment instead of requiring Ctrl-Alt-R#2658
Auto-reload shell environment instead of requiring Ctrl-Alt-R#2658domenkozar merged 3 commits intomainfrom
Conversation
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:
Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2026-04-08T08:51:25.421Z |
Deploying devenv with
|
| Latest commit: |
a8ccb67
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://10a94b2b.devenv.pages.dev |
| Branch Preview URL: | https://auto-reload-shell.devenv.pages.dev |
|
Changing EDIT: This happens with https://github.com/mcdonc/devenv-zsh turned on (it actually does use |
|
Adding random package: EDIT: This happens with https://github.com/mcdonc/devenv-zsh turned on (it actually does use |
|
If I don't use |
|
Is it possible to support both auto-reload and manual triggering? i.e. introducing a config option for the manual keybind? |
You'd prefer manual reload? |
bc47226 to
bacd1ba
Compare
In some scenarios, possibly. My main issue is that as currently implemented I simply can't use the feature. |
It should reload if you press enter. Can you try again? |
596a6b2 to
9c2d2ed
Compare
…l-Alt-R Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Editors using atomic save (write temp + rename) replace the file inode, which silently invalidates the kernel inotify watch. The watchexec fs worker skips re-watching paths already in its pathset, so the stale watch is never refreshed and subsequent edits go undetected. Add WatcherHandle::rewatch_all() that forces a full refresh by clearing and re-setting the pathset, and call it after each reload build completes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9c2d2ed to
a8ccb67
Compare
|
I've tested and this works now, addressing the issue of manually reloading the shell. We can still introduce possibility to bind it to a key later on, as this matches how direnv worked. |
Summary
PROMPT_COMMANDinstead of requiring the user to press Ctrl-Alt-RFixes #2595.
Test plan
devenv shell, editdevenv.nix, verify environment reloads automatically at next promptcargo nextest run -p devenv-shellpasses (131 tests, snapshot updated)🤖 Generated with Claude Code