On 7. Dec 2006, at 20:42, jeanpierre@gmail.com wrote:
[...] i wonder if it would be possible to tweak the initialization code to handle additional shells based on $SHELL or niutil -readprop / /users/$USER shell
perhaps it could simulate a login shell (of the user's default) and export the environment to be sucked back into bash_init.sh?
i know i have discussed this on IRC a few times and it has been said that apple needs a strategy to provide this, but i really don't understand the technical limitations that would render this task *impossible*. can anyone outline the issues at play or possibly the work that would be necessary to support this?
To pull this off, you basically need to write a script for every existing shell (they have various subtleties in their command language) which dumps the environment in some parse-able form.
Then you need to launch their shell interpreter with this script, and the proper options to get it to first source the proper init resource files, so that it has the environment set up, as in an interactive login shell.
This is:
a) a tedious task (figuring out all this for the various shells), b) would add some overhead to every single operation in TM that needs to have the environment, c) very fragile, as the user could do all sorts of unexpected stuff in his init files.
So b and c is already a problem now (and I’ve had to do ‘support’ related to it more times than I can count), and I will remove the current sourcing of init files for 2.0 (and instead make a better preference system for setting up the PATH with some heuristics/ smartness to make this sort of work out of the box for typical setups).