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
wsl.exe sets first argument as SHELL
breaking posix compatibility and gdb
#10718
Comments
SHELL
breaking posix compatibilitySHELL
breaking posix compatibility and gdb
Due to microsoft/WSL#10718 `SHELL` var is set to `ttyfix` breaking `gdb`. We now: 1. Check if first argument (command to execute) is a valid shell and set `SHELL` accordingly 2. If not, check user default shell. Be it a valid shell, we use it 3. Unset `SHELL` otherwise Review: https://jetbrains.team/p/ij/reviews/118965/timeline GitOrigin-RevId: 425b6886b4b48e29f653413c62326afa8033c694
@throwable-one why not use From wsl.exe help:
You'll notice that the environment is not the same, depending on invocation method:
Use |
It seems wsl is doing the right thing when using |
@zcobol But WSL would use shell then, not my bare command. @asampal There is nothing in WSL documentation that says I can't use arbitrary command with @benhillis thank you for this fix |
Windows Version
Microsoft Windows [Version 10.0.19045.3570]
WSL Version
1.2.5.0
Are you using WSL 1 or WSL 2?
Kernel Version
Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023
Distro Version
Ubuntu 20.04
Other Software
python3
gdb
Repro Steps
The output is python, but according to POSIX
SHELL
variable should point to the valid language interpreter.https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
That is a problem.
gdb
usesSHELL
var to execute commands:https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_19.html#SEC20
As result.
gdb
doesn't work:Expected Behavior
SHELL
shouldn't be set at all or point to valid shellActual Behavior
SHELL
points to the first argumentDiagnostic Logs
No response
The text was updated successfully, but these errors were encountered: