When running toolbox commands, it appears that /bin/sh is always used. I would like this to be configurable so that I can launch commands under bash that can utilize aliases and functions I have created in my bash configuration.
Hi @ravenhall,
You could try running your command directly with “/bin/bash”
/bin/bash -l -c "commands"
That should load your bash config files into the shell that executes your command.
- Carey
Thanks, That does indeed work.
Why isn’t this configurable? Commando appears to use /bin/sh as well. Does Komodo read this from an env var?
Because no one asked for it I suppose:
I’m guess Komodo uses whatever shell it finds first on your path, though it could be hard coded too. I’m having a look through the code now to see if I can tell.
- Carey
So under the hood, the runCommands are being run by the a wrapped version of Popen from Python. If we wanted to allow users to specify a custom shell then we could extend our wrapper to support the executable
arg for the Popen constructor which we invoke directly: https://github.com/Komodo/KomodoEdit/blob/master/src/python-sitelib/process.py#L348, so that’s pretty fun!
- Carey
I’ll put in a new issue to request it. If it could use the environment variable specified in $SHELL (if it is set) it could be easily customized and would follow the UNIX philosophy of Least Surprise.