You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A key feature of direnv is its shell hook (eval "$(direnv hook fish)" etc.) which automatically activates/deactivates environments when cd-ing into/out of project directories. This is essential for seamless developer experience — the environment just works without manually running any command.
As devenv moves toward replacing direnv (#2061), an equivalent mechanism is needed: automatic environment activation/deactivation triggered by directory changes.
Expected behavior
Devenv should provide a shell hook (for bash, zsh, and fish) that:
Detects when the user enters a directory with a devenv.nix / devenv.yaml
Automatically activates the devenv environment (ideally with background evaluation, as noted in Replace direnv with Rust #2061)
Deactivates/restores the previous environment when leaving the directory
Works with nested projects (inner project takes precedence)
This is the main remaining blocker for fully replacing direnv with devenv.
Problem
A key feature of direnv is its shell hook (
eval "$(direnv hook fish)"etc.) which automatically activates/deactivates environments whencd-ing into/out of project directories. This is essential for seamless developer experience — the environment just works without manually running any command.As devenv moves toward replacing direnv (#2061), an equivalent mechanism is needed: automatic environment activation/deactivation triggered by directory changes.
Expected behavior
Devenv should provide a shell hook (for bash, zsh, and fish) that:
devenv.nix/devenv.yamlThis is the main remaining blocker for fully replacing direnv with devenv.
Related
This issue was created on behalf of @schickling