Open ghost opened 8 years ago
You would have to write your own post-switching commands system.
Or use one of the zillions that already exist... Here are some notes from a year ago when I needed to solve this. (I ended up writing a one-off script, eschew overengineering)
@bronson right, the real problem is Bash doesn't support something like preexec_functions
. You have to either inject a command into PROMPT_COMMAND
(only works in interactive mode) or use trap DEBUG
(not inherited by sub-processes). So most of these Bash solutions clobber any previously inserted Bash "hooks".
Would the idea proposed in #227 make this easier?
@ilikepi providing a function would allow users to manually set the trap DEBUG
command. Manually injection into trap DEBUG
is still impossibly/difficult unless set -T
is set.
Right... so does that mean you agree with this proposal (in a general sense)? I'm happy to put together a PR for further discussion.
On Jan 5, 2016, at 20:33, Postmodern notifications@github.com wrote:
@ilikepi providing a function would allow users to manually set the trap DEBUG command. Manually injection into trap DEBUG is still impossibly/difficult unless set -T is set.
— Reply to this email directly or view it on GitHub.
I have a ruby 1.8 install where I must set RUBYLIB manually before any ruby programs will work ... is it possible to have chruby do this automatically when switching to ruby 1.8? I don't see a way ... it would be nice to be able to take arbitrary actions when switching rubies ...