Skip to content

"The following extensions want to relaunch the terminal to contribute to its environment: direnv" #639

Open
@Nezteb

Description

@Nezteb

I frequently get prompted by VS Code to reload the direnv extension with a message like so:

screenshot_2023-10-19_at_19 08 29@2x

OS: macOS 13.6 (M2)
Editor: VS Code 1.84.0-insider
Extension: v0.15.2
Shell env: Nushell 0.85.0

My Nushell config:

# ~/.config/nushell/config.nu

# ...
$env.config = {
    # ...
    hooks: {
        # ...
        env_change: {
            # https://direnv.net/docs/hook.html#nushell
            PWD: { ||
                if (which direnv | is-empty) {
                    return
                }
            
                direnv export json | from json | default {} | load-env
            }
        }
        # ...
    }
    # ...
}
# ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions