Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

direnv hook "cannot find column 'PWD'" #1026

Open
andar1an opened this issue Jan 27, 2025 · 2 comments
Open

direnv hook "cannot find column 'PWD'" #1026

andar1an opened this issue Jan 27, 2025 · 2 comments

Comments

@andar1an
Copy link

I am nu to nushell, and am trying to integrate direnv in the config.

I have copied the hooks to the correct config path, however when I launch my terminal and nushell I get the following error:

 22$env.config.hooks.env_change.PWD = (
 23$env.config.hooks.env_change.PWD | append (source nu-hooks/nu-hooks/direnv/config.nu)
    ·                                  ─┬─
    ·                                   ╰── cannot find column 'PWD'
 24 │ )

I thought that PWD was supposed to automatically be set, and manually trying to set is in config throws and error that it can't be set manually.

How am I supposed to add this hook to my config so that PWD column is available?

Thanks for the help.

@0xpositronic
Copy link

0xpositronic commented Feb 15, 2025

using this config fixed the same issue for me

$env.config = {
    hooks: {
        env_change: {
            PWD: (
                $env.config.hooks.env_change.PWD? | default []
                | append {||
                    if (which direnv | is-empty) {
                        return
                    }
                    direnv export json | from json | default {} | load-env
                }
            )
        }
    }
}

@andar1an
Copy link
Author

andar1an commented Feb 15, 2025

Ya, I ended up using that from website as well, but it had suggested using nu-hooks scripts in repo for latest version. That is what doesn't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants