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
Don't trust process.env.SHELL #2
Comments
👎 I don't think we should distrust it just because one user has a misconfigured system. With that logic nothing can be trusted. I would be open to it if it were a common problem, but that's not the case. |
I tend to agree, but I think it's at least worth investigating if there are more reliable ways find the user's shell, a environment variable just seems too brittle. On Linux, I'd probably put more trust into the |
Alright. I did research doing more extensive checks initially, including using |
Okay let's leave it simple. Doing |
Not even possible. OS X no longer uses passwd. https://github.com/sindresorhus/passwd-user/blob/09cc55af4d8d0a94885ce318cd3993d44ef7aa44/index.js#L81-L83 |
Since I started this little issue in the linked (now closed) bug... let me know if you need me to test out anything. While I've done a clean install on my Mac, I have a cloned, bootable drive of the disk as it was when it showed the problem. |
@rickgregory one think I'm still wondering about is how your regular shell was still working. I wouldn't totally exlude the possibilty of a bug in electron. Maybe the output of these from your terminal may help us track this further:
|
My standard shell is bash, not zsh. I'll boot from the external clone $ /bin/zsh --version On Tue, Feb 16, 2016 at 1:45 PM, silverwind notifications@github.com
|
As seen in sindresorhus/shell-path#10 (comment),
process.env.SHELL
can't be trusted to work in certain situations, leading to hard to debug errors.I think we should first
stat
and check for the executable bit, and possibly fallback to well-known shell paths like/bin/bash
or/bin/zsh
on error.The text was updated successfully, but these errors were encountered: