Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

devbox integrate does NOT run init_hook #2703

Copy link
Copy link
@tm-michael

Description

@tm-michael
Issue body actions

What happened?

When the VSCode extension is run and on selects "Reopen devbox", it only sets the env variables but it doesn't run the init hook. Init hooks can include important steps and set other environment variables that aren't set using the env key in the devbox.json. When using things like Cursor or extensions that open their own shells and don't get the devbox shell injection, they thus lack important variables

Steps to reproduce

  1. create a devbox.json with an init_hook that sets an environment variable e.g TEST=true
  2. open the project in VSCode with the extension installed and the "devbox shell" injection deactivated Image
  3. use the "reopen in devbox" feature
  4. open a terminal and run echo $TEST

It will not be set.

Command

No response

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
  "packages": [],
  "env": {
    "SOMETHING": "hello"
  },
  "shell": {
    "init_hook": [
      "export TEST=true"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.16.0

Nix version

2.31.0

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

apgrucza

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workingtriageIssue needs triageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.