# Direnv, project environment and zsh

**URL:** <https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707>\
**Category:** Help\
**Created:** [March 28, 2023, 7:16pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707 "2023-03-28T19:16:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 28, 2023, 7:16pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/1 "2023-03-28T19:16:37Z")

</div>

Hi,

I have an issue involving `direnv`, a project environment and `zsh`.

I have in my `.zshrc` a line saying `eval "$(direnv hook zsh)"`. This comes from the `direnv` installation guide.  
I also created a project environment for one of my projects and a `.envrc` file containing `flox activate` to activate the project environment when entering the directory.

However when I enter the directory it seems that a loop is triggered and I get many messages like:

```auto
direnv: ([/Users/etorreborre/.local/share/flox/environments/etorreborre/default/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.

```

What can I do about this? Thank you.

---

<div class="post-metadata">

**Author:** ![aameen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/aameen/32/564_2.png) [@aameen](https://discourse.flox.dev/u/aameen)\
**Post date:** [March 28, 2023, 9:12pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/2 "2023-03-28T21:12:15Z")

</div>

Did you use `flox activate;` or `. <( flox activate; );`?

For `direnv` you’ll want to be sure to use the second one.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 28, 2023, 10:01pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/3 "2023-03-28T22:01:04Z")

</div>

That’s the same thing, I need to interrupt with Ctrl-C.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 28, 2023, 10:03pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/4 "2023-03-28T22:03:01Z")

</div>

Actually it seems that it is not deterministic, sometimes it works ok.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 28, 2023, 10:11pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/5 "2023-03-28T22:11:34Z")

</div>

I think I know what it is… And it would have been hard for you to debug. Somewhere in the activation of the environment, `flox` tries to access a repository. However I have a key in a Yubikey which requires me to press it when it blinks. If I do it, everything is ok.

I used the debug mode to activate the environment and I can see

```auto
+ /nix/store/l5100vm321ay7i2kanfcai6na1dp6lqx-git-minimal-2.39.1/bin/git -c 'credential.https://github.com.helper=!/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/gh auth git-credential' -C /Users/etorreborre/.cache/flox/meta/etorreborre fetch origin

```

Can this be deactivated? Maybe, even if that is not only to solve this issue but just to make `activate` faster?

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [March 29, 2023, 11:31am UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/6 "2023-03-29T11:31:57Z")

</div>

Hej Eric

Thanks for helping out debugging this, i agree that could have been a tough one for us on our own.

The request is part of the auto update feature [1].  
Disabling auto updates via [2]:

```auto
. <(FLOX_AUTOUPDATE=0 flox activate)

```

should get you around that.

Thanks for bringing this up,  
in case of the `. <(flox activate)` we might prefer speed over updates anyway especially since this can cause issues with user interaction as you have experienced.

[1] [flox-bash/activate.sh at db7efcacb5f5935b286006288f23f931a573a918 · flox/flox-bash · GitHub](https://github.com/flox/flox-bash/blob/db7efcacb5f5935b286006288f23f931a573a918/lib/commands/activate.sh#L152-L170)

[2] [flox-bash/metadata.sh at db7efcacb5f5935b286006288f23f931a573a918 · flox/flox-bash · GitHub](https://github.com/flox/flox-bash/blob/db7efcacb5f5935b286006288f23f931a573a918/lib/metadata.sh#L1112)

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 29, 2023, 12:38pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/7 "2023-03-29T12:38:45Z")

</div>

Thanks Yannik. I still think that something is trying to access git even with `FLOX_AUTOUPDATE=0`.  
If I use `flox activate -v` the last 2 lines before I need to press my Yubikey are

```auto
# echo "Supercharged by flox!" 1>&2

/nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/rm /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.JN2oPboX

```

Does that help?

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 29, 2023, 12:39pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/8 "2023-03-29T12:39:57Z")

</div>

The full debug logs are

```auto
[DEBUG] [flox::config] `$FLOX_CONFIG_HOME` not set, using "/Users/etorreborre/.config/flox/"
[DEBUG] [flox::config] `FLOX_CONFIG_HOME` not set, using "/Users/etorreborre/.config/flox/"
[DEBUG] [flox::utils::init::metrics] Attempting to read own UUID from file
[DEBUG] [flox] Running in flox with arguments: ["--debug", "activate"]
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:149 hash_commands( ansifilter awk basename bash cat chmod cmp column cp curl cut dasel date dirname getent gh git grep gum id jq ln man mkdir mktemp mv nix nix-editor nix-store pwd readlink realpath rm rmdir sed sh sleep sort stat tail tar tee touch tr uname uuid xargs zgrep )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:169 first_in_PATH( vim vi nano emacs ed )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/bootstrap.sh:25 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB 1 get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB --args -- get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/bootstrap.sh:27 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB 1 get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB --args -- get floxClientUUID )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/bootstrap.sh:66 floxUserMetaRegistry( get floxMetricsConsent )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB 1 get floxMetricsConsent )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB --args -- get floxMetricsConsent )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/init.sh:350 updateFloxFlakeRegistry( )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1240 getChannelsJSON( )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1218 floxUserMetaRegistry( get channels )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:699 registry( /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB 1 get channels )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/f1/z4ywgsbx7572r2wmslwy778w0000gn/T/tmp.yUZRQX9ZiB --args -- get channels )
trace:/dev/fd/63:1 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP etorreborre github:etorreborre/floxpkgs/main )
trace:/dev/fd/63:2 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP flox github:flox/floxpkgs/master )
trace:/dev/fd/63:3 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP nixpkgs-flox github:flox/nixpkgs-flox/master )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1247 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP nixpkgs github:flox/nixpkgs/stable )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1248 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP nixpkgs-stable github:flox/nixpkgs/stable )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1249 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP nixpkgs-staging github:flox/nixpkgs/staging )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1250 invoke( /nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/nix registry add --registry /Users/etorreborre/.config/flox/tmp.xxhKuHxvGP nixpkgs-unstable github:flox/nixpkgs/unstable )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/flox:132 submitMetric( activate )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/flox:164 selectDefaultEnvironment( activate /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/development.sh:563 selectAttrPath( /Users/etorreborre/projects/ockam/ockam-1 activate floxEnvs )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:1373 lookupAttrPaths( /Users/etorreborre/projects/ockam/ockam-1 floxEnvs )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/flox:198 floxActivate( /Users/etorreborre/projects/ockam/ockam-1#ockam aarch64-darwin )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:154 doAutoUpdate( /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:154 doAutoUpdate( /Users/etorreborre/.local/share/flox/environments/etorreborre/default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:171 trailingAsyncFetch( /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default /Users/etorreborre/.local/share/flox/environments/etorreborre/default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/metadata.sh:1181 decodeEnvironment( /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/metadata.sh:1181 decodeEnvironment( /Users/etorreborre/.local/share/flox/environments/etorreborre/default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/metadata.sh:1189 _trailingAsyncFetch( /Users/etorreborre/.cache/flox/meta/etorreborre )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:183 identifyParentShell( )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/metadata.sh:1171 githubHelperGit( -C /Users/etorreborre/.cache/flox/meta/etorreborre fetch origin )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/metadata.sh:369 invoke( /nix/store/l5100vm321ay7i2kanfcai6na1dp6lqx-git-minimal-2.39.1/bin/git -c 'credential.https://github.com.helper=!/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/gh auth git-credential' -C /Users/etorreborre/.cache/flox/meta/etorreborre fetch origin )
+ /nix/store/l5100vm321ay7i2kanfcai6na1dp6lqx-git-minimal-2.39.1/bin/git -c 'credential.https://github.com.helper=!/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/libexec/flox/gh auth git-credential' -C /Users/etorreborre/.cache/flox/meta/etorreborre fetch origin
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:210 decodeEnvironment( /Users/etorreborre/projects/ockam/ockam-1#ockam )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:956 flakeTopLevel( /Users/etorreborre/projects/ockam/ockam-1 )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:958 flakeMetaDir( /Users/etorreborre/projects/ockam/ockam-1 )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:210 decodeEnvironment( /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:216 joinString( : /Users/etorreborre/projects/ockam/ockam-1/.flox/envs/aarch64-darwin.ockam/bin /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/bin /Users/etorreborre/.local/share/flox/environments/etorreborre/default/bin:/opt/homebrew/bin:/Applications/google-cloud-sdk/bin:/Users/etorreborre/.ghcup/bin:/Users/etorreborre/.cabal/bin:/Users/etorreborre/.local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/etorreborre/.fzf/bin )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:217 joinString( : /Users/etorreborre/projects/ockam/ockam-1#ockam/share /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/share '' )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:218 joinString( : /Users/etorreborre/projects/ockam/ockam-1#ockam /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default /Users/etorreborre/.local/share/flox/environments/etorreborre/default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:219 joinString( ' ' .#ockam default default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:247 bashRC( /Users/etorreborre/projects/ockam/ockam-1#ockam /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:20 decodeEnvironment( /Users/etorreborre/projects/ockam/ockam-1#ockam )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:956 flakeTopLevel( /Users/etorreborre/projects/ockam/ockam-1 )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/utils.sh:958 flakeMetaDir( /Users/etorreborre/projects/ockam/ockam-1 )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:22 invoke( /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/etorreborre/projects/ockam/ockam-1/.flox/envs/aarch64-darwin.ockam/activate )
+ /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/etorreborre/projects/ockam/ockam-1/.flox/envs/aarch64-darwin.ockam/activate
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:20 decodeEnvironment( /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default )
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:22 invoke( /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/activate )
+ /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/activate
trace:/nix/store/ifh1jqp2yc2pgiaf7fqgi4qpz0q82iyp-flox-0.0.10-r216/lib/commands/activate.sh:308 darwinRepairFiles( )
export SSL_CERT_FILE="${SSL_CERT_FILE:-/nix/store/s4blnzinsjx0891ssrp3mphsam58psdp-nss-cacert-3.86/etc/ssl/certs/ca-bundle.crt}"
export NIX_SSL_CERT_FILE="${NIX_SSL_CERT_FILE:-$SSL_CERT_FILE}"
export NIX_COREFOUNDATION_RPATH="/nix/store/sw2zrmkm5kqp8klvlsa2acvhfsff51pg-apple-framework-CoreFoundation-11.0.0/Library/Frameworks"
export PATH_LOCALE="/nix/store/cjq36wj1jb7g7bfna8n2qy8kzc16slll-adv_cmds-119-locale/share/locale"
export PATH="/Users/etorreborre/projects/ockam/ockam-1/.flox/envs/aarch64-darwin.ockam/bin:/Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/bin:/Users/etorreborre/.local/share/flox/environments/etorreborre/default/bin:/opt/homebrew/bin:/Applications/google-cloud-sdk/bin:/Users/etorreborre/.ghcup/bin:/Users/etorreborre/.cabal/bin:/Users/etorreborre/.local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/etorreborre/.fzf/bin"
export XDG_DATA_DIRS="/Users/etorreborre/projects/ockam/ockam-1#ockam/share:/Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default/share"
export FLOX_ACTIVE_ENVIRONMENTS="/Users/etorreborre/projects/ockam/ockam-1#ockam:/Users/etorreborre/.local/share/flox/environments/etorreborre/aarch64-darwin.default:/Users/etorreborre/.local/share/flox/environments/etorreborre/default"
export FLOX_PROMPT_ENVIRONMENTS=".#ockam default"
export FLOX_PROMPT_COLOR_1="61"
export FLOX_PROMPT_COLOR_2="216"
export LANG='en_US.UTF-8'

# echo "Supercharged by flox!" 1>&2

Confirm user presence for key ECDSA-SK SHA256:PZdIbixOGJ9mdo4e2n1qAQtdTbM26JI+OpUuL01tAms
User presence confirmed

```

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [March 31, 2023, 10:59am UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/9 "2023-03-31T10:59:33Z")

</div>

Thank you these logs do help.

To pinpoint the issue could you help me by answering a few questions:

1. do you run the `.envrc` in a project with a flox.nix/project env? Does this project use `git+ssh://git@github.com/...` inputs?  
I can tell you’re activation .#ockam?
2. do you have any shell hooks defined?
3. do you still get multiple `direnv: ... is taking a while` messages?

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [March 31, 2023, 1:39pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/10 "2023-03-31T13:39:11Z")

</div>

1. yes I am using `.envrc` in a directory with a project environment. The project inputs are the default flox ones `inputs.flox-floxpkgs.url = "github:flox/floxpkgs";`

2. I have tried with no shell hook and with `eval "$(starship init zsh)"` (for prompts) and I get the same behaviour in 3.

3. I see just one message and then the project environment is activated after 30s but this is not deterministic. Sometimes the environment is activated just after 2s

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [April 5, 2023, 9:13am UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/11 "2023-04-05T09:13:53Z")

</div>

Hej Eric  
Quick status update; we have diagnosed the problem and are working on a solution now.  
Thanks for pointing us the right way!

---

<div class="post-metadata">

**Author:** ![aameen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/aameen/32/564_2.png) [@aameen](https://discourse.flox.dev/u/aameen)\
**Post date:** [April 12, 2023, 8:09pm UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/12 "2023-04-12T20:09:48Z")

</div>

@etorreborre I think I found the cause of this when I was working on the other `direnv` response for you.

It looks like `flox` isn’t detecting non-interactive shells, so if you have multiple envs in a project ( the default + any package ) it will try to prompt you to select. You won’t see the prompt because it’s not an interactive shell, and it’ll just hang.

If you instead explicitly use `. <( flox activate -e '.#default'; );` it shouldn’t hang.  
I’ve filed a bug fix ticket for this so hopefully we can get it resolved soon.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [April 13, 2023, 8:24am UTC](https://discourse.flox.dev/t/direnv-project-environment-and-zsh/707/13 "2023-04-13T08:24:19Z")

</div>

I confirm that it works great, thanks!
