-
Notifications
You must be signed in to change notification settings - Fork 407
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
Ignore interrupts and wait for child process to exit #119
base: main
Are you sure you want to change the base?
Conversation
I've been using Adam's patched version for a while now and it works great. Can we get this merged please @joho? Thanks! |
Using exec is better in this case as it makes the process tree simpler, and allows the child's signals to be handled by the caller. In addition the `Exec` function has been removed as it's not really great as a library function. Users should manually call the `Load` function and run `exec.Command` or `syscall.Exec` appropriately. In the future we probably want to handle signals for Windows anyway. This is based on joho/godotenv#77 and also addresses the following PRs in upstream: - joho/godotenv#119
@joho any chance to see this merged? |
👍 It would be great to have this fix released! Alternatively, I was looking at somewhat similar tools like aws-env and it uses |
Hey @AdamSLevy I was wondering in the meantime would you be able to rebase your fork to be in sync with the latest release here? I'd also love to switch to your version but not as familiar with how to install/build it - would you be able to share how we can get up and running? Thanks in advance! |
I also have this annoying signal issue, would like to see this PR getting merged! Thanks! |
Looks like node's dotenv-cli has the same issue, Only ruby's dotenv is working fine, I will switch to the ruby version for now. |
Here is the simple test code, if you want to reproduce this:
|
Because signals were not handled, godotenv will sometimes exit before its child process, causing unexpected behavior in some apps. Instead ignore interrupts and just wait for the subprocess to exit.
fix #21