PATH not respected in hooks
Describe the bug I use devenv and direnv to make some applications available on a per-directory basis by setting the PATH environment variable. I use it especially to provide project specific git hooks. However, when committing with gitui, those applications don't seem to be available.
To Reproduce Steps to reproduce the behavior:
- Create a script somewhere, lets call it
my-own-script - Add its parent to the
PATH - Create a pre-commit hook that uses
my-own-script - Try to commit using gitui
- See it fail because it can't find
my-own-script
Expected behavior gitui being able to see applications in the PATH
Context (please complete the following information):
- NixOS unstable
- gitui 0.24.3
that is so weird. we use https://doc.rust-lang.org/std/process/struct.Command.html#method.new and it is supposed to inherit the parents env
#1968 adds a unittest proving that a hook script has access to PATH on all ci platforms
@Lykos153 can you export your environment in your hook for debug purposes like you see it happening in the referenced unittest. I cannot reproduce your problem
Thank you very much for looking into it! And you're right. I realized that with zsh it is indeed working as expected. It only seems to happen using nushell. But what's strange is that it works with git but not with gitui. Whats the difference in how both call the hook? See https://asciinema.org/a/jXDeNAlsYFHs6TSlALE6KGDnr
I will ask the nushell folks, too.
very strange indeed. i am not using nushell. it seems for some reason the gitui process does not see the new version of the env
closing in case we find new evidence