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.path.executable only works with full path #754

Open
dougg0k opened this issue May 6, 2024 · 9 comments
Open

direnv.path.executable only works with full path #754

dougg0k opened this issue May 6, 2024 · 9 comments

Comments

@dougg0k
Copy link

dougg0k commented May 6, 2024

Hi,

I was trying out the extension, but it seems that it is only able to recognize direnv through the full path.

/home/user/.../direnv

I tried with bash env var $HOME/user/... and it didnt work

I tried with nushell env var $env.HOME/... and it didnt work

and tried with tilde ~/.../direnv and it didnt work.

That does not make the path very flexible in the config, is there a way to make it work with variables or tilde?

Oh, and straight call to direnv does not work.

@mkhl
Copy link
Contributor

mkhl commented May 8, 2024

Sadly vscode doesn't support that, see microsoft/vscode#2809

Oh, and straight call to direnv does not work.

Weird, that should work, that's even the default value. Can you explain this one in a bit more detail?

@dougg0k
Copy link
Author

dougg0k commented May 8, 2024

Sadly vscode doesn't support that, see microsoft/vscode#2809

Oh, and straight call to direnv does not work.

Weird, that should work, that's even the default value. Can you explain this one in a bit more detail?

Not much to explain, it says it didnt found the executable, through the popup on the right bottom in vscode. Only time it doesnt, is with the full path.

@mkhl
Copy link
Contributor

mkhl commented May 8, 2024

Sadly vscode doesn't support that, see microsoft/vscode#2809

Oh, and straight call to direnv does not work.

Weird, that should work, that's even the default value. Can you explain this one in a bit more detail?

Not much to explain, it says it didnt found the executable, through the popup on the right bottom in vscode. Only time it doesnt, is with the full path.

Does the same error occur when you reset the setting to the default value?
Does direnv live in your PATH?

@dougg0k
Copy link
Author

dougg0k commented May 8, 2024

Could be because I am using nushell as default shell, there it is set. It is also the default shell in vscode, but might not matter if internals are tied to bash.

@dougg0k
Copy link
Author

dougg0k commented May 10, 2024

Yeah, confirmed, it's because PATH was not in .bashrc. It's basically forcing you to setup on bash.

@mkhl
Copy link
Contributor

mkhl commented May 11, 2024

Yeah, confirmed, it's because PATH was not in .bashrc. It's basically forcing you to setup on bash.

FWIW that's done by your windowing system (or whatever context you start vscode in), vscode doesn't (and cannot) care about your shell.

@dougg0k
Copy link
Author

dougg0k commented May 11, 2024

Hm, most context are by going through to the folder and typing code .

Not sure where else the default could be changed, I already had changed in chsh and x-terminal-emulator setting.

They dont seem to matter.

@AllanLeanderRostockHansen
Copy link

AllanLeanderRostockHansen commented Aug 12, 2024

I get the same error using the absolute path to direnv, I copy-pasted the output of which direnv into the settings (/opt/homebrew/bin/direnv).
Any suggestion on how to fix this?

Setting it to just direnv (the default value) also raises the error.

@dougg0k
Copy link
Author

dougg0k commented Aug 12, 2024

Solution is what they recommend at direnv, you have to set the eval in the .bashrc or whatever other shell you use, I know that with nushell it does not work.

https://direnv.net/docs/hook.html

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

No branches or pull requests

3 participants