Closed lookis closed 3 years ago
@lookis I'm not sure I fully understand this bug. Would you mind posting some screenshots showing the issue to help out?
I have do a screen recording to reproduce, notice that I open 2nd terminal with shortcut: cmd+t , which i means "drop into" https://www.dropbox.com/s/u3u4eb1o35tmfuh/Screen%20Recording%202020-02-11%20at%206.49.45%20AM.mov?dl=0
Online player compress the video, you can have it downloaded and see
I belive I have the same issue.
Steps to reproduce:
Here you can see that the theme stays for the first switch after starting the terminal and that it is broken after switching to a other directory with a .venv file.
This is how it looks without the plugin:
This only occurs when I have a .venv file in $HOME. Removing that and switching to your default venv in .zshrc is an easy workaround.
I also have this issue. I was able to fix by removing the call to check_venv
that the plugin makes at load time: https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv/blob/459e48d670ba1902cce68e509ebe6b569e771e91/autoswitch_virtualenv.plugin.zsh#L346
The issue here is that we load this plugin before other parts of my zshrc that set PROMPT and PATH and so on. Thus, deactivate
fails to restore these, because they were set after activate
.
I then just call check_venv
manually, towards the end of my zshrc.
I don't know if there's a good way to "defer" calls in zsh, but if you're hesitant to remove the check_venv
call at load time, maybe we could make that configurable?
Edit: and now I see lookis' PR :-)
Thanks @hauntsaninja for that fix, it works for me. Also thanks to @MichaelAquilina for this great plugin
Thanks @hauntsaninja !
I have applied your fix and it solves my problem with losing the prompt, as well as the problem with autojump not being functional anymore.
@hauntsaninja and everyone else in this issue. Do you still experience this bug on the latest release? (3.3.2)
everyone else in this issue. Do you still experience this bug on the latest release? (3.3.2)
No, this issue seems to be fixed for me. Thanks.
Yay, thank you for fixing!
Issue Details
Please provide the following details when opening an issue:
Operating System (uname -a)
Mac 10.15.2
zsh version (zsh --version)
zsh 5.7.1 (x86_64-apple-darwin19.0)
autoswitch-virtualenv version
1.15.0
How is zsh-autoswitch-virtualenv installed?
Steps to reproduce the issue
gist link to your zshrc
Some more Info
virtualenv will remember previous PROMPT when "activate", but theme for oh my zsh will load later:
//work on the project //change folder