3 ms·
Couldn't you also use $PROMPT_COMMAND? This gets executed right before showing the prompt, so cwd would already have been called and it would be much easier to
by pilif 15y ago
Couldn't you also use $PROMPT_COMMAND? This gets executed right before showing the prompt, so cwd would already have been called and it would be much easier to chain.
Of course you'd run more often than when hooking cd, but just checking for a new .rvmrc isn't so expensive.
The problem would probably be that you wouldn't get called from within scripts (there is no prompt there), but that could also be an advantage because it would ensure that a scripts cd would continue to work "headless".
I'd have to look into this and really see what rvm actually needs the hook for. As such I'm just thinking loudly at the moment.