-
-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Labels
Description
@zendeavor points out that it is confusing to users that chruby_auto is invoked before the command is executed and before the prompt is printed. If user's (ex: @jc00ke) include $RUBY_ENGINE and $RUBY_VERSION in their $PS1, then these values wont be updated until the command after the cd command is executed. @zendeavor recommends using different hooking strategies for interactive vs. non-interactive modes.
Interactive
- bash:
PROMPT_COMMAND - zsh:
precmd_functions - ksh:
PS1
Non-interactive
- bash:
trap DEBUG - zsh:
preexec_functions - ksh:
trap DEBUG
This would invoke chruby_auto before PS1 is rendered in interactive mode, but invoke chruby_auto before the command is even executed in non-interactive mode.