Skip to content

Use precmd_functions instead of preexec_functions #465

Description

@sobrinho

Description

preexec_functions does not run early enough for chruby work soon enough for RPS1.

Another way of fixing is calling chruby_auto on ~/.zshrc but precmd_functions seems more appropriate. Maybe?

Steps To Reproduce

Steps to reproduce the bug:

  1. Use ZSH
  2. Create .ruby-version with any version
  3. export RPS1="%F{240}host %F{255}%m %F{240}pwd %F{255}%1~ %F{240}vcs %F{255}\${vcs_info_msg_0_:-ッ} %F{240}ruby %F{255}\$(chruby_prompt_info || echo ッ) %F{240}node %F{255}\$(node -v || echo "ッ")"
  4. Open a new tab in that directory

Expected Behavior

Screen Shot 2021-09-15 at 13 55 26

Actual Behavior

Screen Shot 2021-09-15 at 13 54 17

Environment

$ bash --version # if applicable
...
$ zsh --version # if applicable
zsh 5.8 (x86_64-apple-darwin20.0)
$ chruby --version
chruby: 0.3.9
$ ruby --version
...
$ gem --version
...
$ gem env
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions