Skip to content

fish shell _pyenv_virtualenv_hook slow #338

Description

@ephes

Hi *,

thanks for this awesome project at first :).

I noticed that my fish shell got really slow when just pressing enter compared to bash and I figured out that the line "status --is-interactive; and source (pyenv virtualenv-init -|psub)" in my fish config caused this to happen. It looks like this line creates a function that listens to the fish_prompt event:

function _pyenv_virtualenv_hook --on-event fish_prompt
	set -l ret $status
  if [ -n "$VIRTUAL_ENV" ]
    pyenv activate --quiet; or pyenv deactivate --quiet; or true
  else
    pyenv activate --quiet; or true
  end
  return $ret
end

I'm not sure what this function does, but it seems to get executed every time the fish_prompt is shown, which causes indeed performance problems. Would it maybe be enough to just listen to "--on-variable PWD" which would cause it to be executed every time the working directory changes?

best,
jochen

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions