-
Notifications
You must be signed in to change notification settings - Fork 104
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
SHELL environment variable is set incorrectly #136
Comments
None of mintty, wslbridge, or the profile scripts on the system where I reproduced this (kali-linux) set the SHELL variable. Somebody with detailed knowledge of what happens under the hood when logging in to Linux may be needed to give us a clue. @rprichard perhaps? |
I'm running openSUSE Tumbleweed WSL and I did notice this issue too. |
I'm on ArchWSL, same issue here. |
That patch is based on a rather old commit of wslbridge and I do not see right away how to apply it to the current version. It would be good to consolidate this first, then convince rprichard to accept the patch, and then it can be integrated with wsltty. Provided it works, of course. |
Is that the wrong repo for wslbridge? I don't see any commits that would conflict with the patch -- or really any significant ongoing work at all. The patch works, when setting up a login session and changing the shell it is correct to set the SHELL variable. For reference see linux login.c: |
The repo is the right one. |
The patch would cleanly apply to the master branch of wslbridge despite being 1 unrelated commit behind. Regardless, I have rebased so it is now 0 commits behind, and also built a wslbrigdge-backend binary including the patch for any testing, anyone wishes to do. https://github.com/j-c-m/wslbridge/releases/tag/0.2.5-dev-shellEnv |
I understand the confusion now, that commit was referenced for the concept. The actual update I made was against the newest master at the time. |
Thanks for the note. This is not a generic solution, however, and it could be accomplished as well within the WSL startup scripts. Maybe even better there as you would be able to determine the actual shell being used and set that into SHELL. |
I am well aware, it was meant as a workaround, until a generic solution is found. |
I recently ran into this issue as well. As an alternative solution to the complex mintty invocation shown above, I seem to be able to just add a:
snippet into my EDIT: Obviously, this only works for zsh and will need to be customized for any other shell, e.g. apparently fish exports a |
Midnight commander also due to this issue can't use shell.... it turns out also due to the shell variable is not set to shell as in /etc/passwd but default to /bin/bash. Both default WSL1 terminal and the new Windows terminal preview do not have this issue. setting [ -z "$ZSH_VERSION" ] || export SHELL="/bin/zsh" in .zshrc helps. |
@Biswa96, would wslbridge2/hvpty handle this better? |
For my wslbridge2 repo, as I told before, |
Are there plans to switch to @Biswa96 wslbridge2? It seems to fix this issue (and others) and the original wslbridge appears abandoned. |
Yes, mintty 3.0.3 is in preparation and wsltty release shall follow it. |
Released 3.0.5 with new gateway. |
* Increase CharNarrowing to mitigate a rendering issue with heavy glyphs mintty/mintty#922 * Uses wslbridge2, which sets the SHELL environment variable correctly mintty/wsltty#136
* Disables automatic character narrowing for technical symbols mintty/mintty#922 * Uses wslbridge2, which sets the SHELL environment variable correctly mintty/wsltty#136
* Disables automatic character narrowing for technical symbols mintty/mintty#922 * Uses wslbridge2, which sets the SHELL environment variable correctly mintty/wsltty#136
* Disables automatic character narrowing for technical symbols mintty/mintty#922 * Uses wslbridge2, which sets the SHELL environment variable correctly mintty/wsltty#136
* Disables automatic character narrowing for technical symbols mintty/mintty#922 * Uses wslbridge2, which sets the SHELL environment variable correctly mintty/wsltty#136
In my WSL I have my shell set (using
chsh
) tozsh
. When I launch wsltty I do indeed get azsh
shell, but theSHELL
environment variable is set to/bin/bash
. This did not happen under the default Windows terminal. Using the default Windows terminal theSHELL
environment variable was set correctly to/bin/zsh
. Do you have any idea why this is happening? I wondered if #95 was related but I was not sure.The text was updated successfully, but these errors were encountered: