Skip to content

"activate" command breaks fish-shell PS1 #51

Closed

Description

@douglascamata

In my current oh-my-fish theme (numist) I type command in the second line, but when I activate my pyenv-virtualenv it breaks and goes back to the same line as the other info. Check the screenshot for details.

image

Activity

  1. yyuu commented on Oct 22, 2014

    @yyuu
    Collaborator

    Do you have 'eval "$(pyenv virtualenv-init -)"' in your fish configuration?

    On Thursday, October 23, 2014, Douglas Camata [email protected]
    wrote:

    In my current oh-my-fish https://github.com/bpinto/oh-my-fish/ theme
    (numist) I type command in the second line, but when I activate my
    pyenv-virtualenv it breaks and goes back to the same line as the other
    info. Check the screenshot for details.

    [image: image]
    https://cloud.githubusercontent.com/assets/159076/4745920/8ab6f1dc-5a41-11e4-89a0-05fbc45365e4.png

    —
    Reply to this email directly or view it on GitHub
    #51.

    山下 優 (やました ゆう)
    [email protected]

  2. douglascamata commented on Oct 22, 2014

    @douglascamata
    Author

    @yyuu sort of, I had to use these commands 'cause that you provided doesn't work:

    status --is-interactive; and . (pyenv init -|psub)
    status --is-interactive; and . (pyenv virtualenv-init -|psub)
    
  3. yyuu commented on Oct 25, 2014

    @yyuu
    Collaborator

    Actually, pyenv and pyenv-virtualenv are not doing anything for prompts. Changing prompt is done in the ${virtualenv}/bin/activate.fish script.

    I tested to change fish prompt and then activate the virtualenv via pyenv activate, but it doesn't remove newline in the prompt string.

    % fish
    Welcome to fish, the friendly interactive shell
    Type help for instructions on how to use fish
    yyuu@sid ~> function fish_prompt
                    echo "blah blah blah"
                    echo "% "
                end
    blah blah blah                                                                                                                                                               
    % 
    blah blah blah                                                                                                                                                               
    % pyenv versions
      system
      2.5.6
      2.7.7
      2.7.8
      3.3.4
      3.3.5
      3.3.6
      3.4.1
    * 3.4.2 (set by /home/yyuu/.pyenv/version)
      jython-2.7-beta3
      miniconda3-3.7.0
      pypy-2.3.1
      pypy-2.4.0-src
      pypy3-2.3.1
      stackless-3.4.1
      venv27
      venv34
    blah blah blah                                                                                                                                                               
    % pyenv activate venv27
    (venv27)blah blah blah                                                                                                                                                       
    % 
    

    Here's the screenshot.

    fish prompt

  4. yyuu commented on Oct 25, 2014

    @yyuu
    Collaborator

    @douglascamata Probably, something is going wrong in oh-my-fish since pyenv-virtualenv does nothing special for fish's prompt. I am not a user of oh-my-fish though. Could you check aboud the prompt configuration in oh-my-fish?

  5. douglascamata commented on Oct 28, 2014

    @douglascamata
    Author

    @yyuu here's a gist with the numist oh-my-fish theme's prompt, https://gist.github.com/douglascamata/e409fd77e9c61dcbdc44. I'm trying to find something, would love some help.

  6. mrvkino commented on Apr 5, 2015

    @mrvkino

    I can confirm the behaviour with my own fish_prompt.fish. Here is an example with my own prompt (with extra new line) and the same example you did.

    virtualenv
    virtualenv2

    I am using echo and echo -n and insert logic to determine the color or my ">" character. I run the latest fish, pyenv and virtualenv. I also have oh-my-fish, but only use it to load rbenv.

    I commented the oh-my-fish commands in my config.fish, as a test, to prevent it from loading and the same thing was happening.

    For the time being I added "set -x VIRTUAL_ENV_DISABLE_PROMPT 1" in my config, to prevent the prompt from being modified.

  7. yyuu commented on Nov 6, 2015

    @yyuu
    Collaborator

    This must not happen anymore since we stopped using virtualenv's 'activate' script in #104

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