devbox icon indicating copy to clipboard operation
devbox copied to clipboard

[direnv] `DEVBOX_SHELL_ENABLED` is missing from `devbox generate direnv --print-envrc`

Open miklschmidt opened this issue 1 month ago • 0 comments

What happened?

When using direnv to load the devbox environment, DEVBOX_SHELL_ENABLED is never set. The documentation is confusing on whether this is intended or not:

on env-variables documentation it says:

DEVBOX_SHELL_ENABLED Whether or not Devbox is enabled in the current shell. This is automatically set to 1 when you start a shell, run a script, or start services.

I guess it can be argued that direnv doesn't start a shell. However, the documentation explicitly says otherwise:

Image

This behavior has been observed on MacOS w/ Apple Silicon as well as Linux x86_64 (NixOS).

Steps to reproduce

  1. devbox generate direnv
  2. cd myproject
  3. echo $DEVBOX_SHELL_ENABLED prints nothing, expected 1.

Command

No response

devbox.json


Devbox version

0.16.0

Nix version

No response

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

miklschmidt avatar Nov 17 '25 13:11 miklschmidt