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

Add shell-wrapper to inject env variables into non-login shells #452

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

nzbr
Copy link
Member

@nzbr nzbr commented Apr 14, 2024

Add a wrapper around every user shell so that we can make sure that the environment gets set. bash does not source /etc/bashrc when running non-interactively, thereby breaking things like wsl -d nixos <some command> (unless the full path to the command is specified of course). This is not a problem for other distros, because Microsoft's /init binary adds some common locations to the PATH before starting the shell, but we don't have those here.

As a welcome side-effect, this also fixes #399

(I didn't notice that this was a problem until I tried to fix the Windows tests, because zsh doesn't have this problem. It just always sources its config files)

@nzbr nzbr added the bug Something isn't working label Apr 14, 2024
@nzbr nzbr changed the title Fix non-interactive shells fix: non-interactive shells Apr 14, 2024
@nzbr nzbr requested a review from K900 April 14, 2024 04:35
@nzbr nzbr changed the title fix: non-interactive shells fix: non-interactive bash Apr 14, 2024
@nzbr nzbr merged commit 03b52c7 into main Apr 26, 2024
25 checks passed
@nzbr nzbr deleted the shell-wrapper branch April 26, 2024 04:21
@nzbr nzbr added the enhancement New feature or request label Jul 7, 2024
@nzbr nzbr changed the title fix: non-interactive bash Add shell-wrapper to inject env variables into non-login shells Jul 7, 2024
@nzbr nzbr removed the bug Something isn't working label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nu shell (nushell) with no PATH set on nixos-wsl
1 participant