skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.66k stars 185 forks source link

Change shell in bash + shopt: not found #131

Closed ubaldot closed 1 month ago

ubaldot commented 1 month ago

I wish to use a bashbut in-spite I added shell = /bin/bash in the w64devkit.ini file, if I echo $SHELL I get/bin/sh. Even if I try to exec bash, I have $SHELL is/bin/sh.

Moreover, when I try to source a .bashrc file I getshopt: not found that is supposed to be builtin in bash.

skeeto commented 1 month ago

Per the documentation comment within w64devkit.ini, there are currently only two supported keys: "title" and "home". Anything else is ignored. If you're using a custom shell, there's not much reason to launch through w64devkit.exe anyway. Its whole job is to set some environment variables (mainly prepend w64devkit/bin to $PATH) then launch its own shell.

Instead you may want to add w64devkit/bin/ to $PATH in your .bashrc, which makes its commands available in your shell. It includes unix utilities, so you probably want it at the end where it won't override your primary environment. Though that will also hide w64devkit's toolchain if you already have one on your PATH.

Part of your difficulty is that there's a "bash.exe" in bin/ that's just an alias for the busybox-w32 shell, which only has a few bash features.

In general w64devkit will not integrate well with MSYS2, Cygwin, etc. (assuming that's where your Bash comes from). The whole point of the distribution is that you don't need to install those heavyweight platforms in the first place. They provide their own Mingw-w64 toolchains, if that's what you need.

ubaldot commented 1 month ago

Ok! Many thanks for your exhaustive answer. Yes, I got confused when I saw a bash.exe in bin/ and I tried to update the .ini file. And nice that I can use its binaries in other shells actually!!

Now that the mission of this distribution is clear, it is easier to get certain answers :)