-
Notifications
You must be signed in to change notification settings - Fork 938
vi_mode suddenly stopped working #319
Comments
So I have my zsh dot files update my theme every once in a while. It seems that ever since commit 520eed1 vi_mode is no longer working. Commits before that exhibit the correct behavior. |
Okay so if I run manually:
vi_mode will work once more. I am running on zsh version 5.2 which is the latest so it seems those overrides are still needed, so perhaps it would be wise to bring them back. |
i am also seeing this behavior. @agsimeonov , did you add this logic to your ~/.zshrc, or what? |
Yeah @machinshin, after adding the above snippet to my ~/.zshrc vi_mode works fine. |
Same issue here. I just enabled vi_mode yesterday and found that it does not work. |
I created a pull request #320 which reverts the commit that causes this issue. |
I can confirm this issue on macOS Sierra. |
Hi all - Thanks for the bug report, verifications, and the PR, @agsimeonov! The issue with reverting that commit is that it will slow down performance in git repositories pretty tremendously. Removing that code fixed some slowness in git repos - I had a couple of other users test that their VI prompts still worked before merging, but it looks like we missed something. I'll have to play with the code and see if there is a way to fix the VI mode prompt while not re-introducing the latency in VCS repos. If anyone else wants to help by taking a look at this, I would really appreciate it! The more eyes on it, the better :) |
The PR is not from me. The thanks should go to @agsimeonov :) |
Fixed! Thanks, @qifei9! |
I'm still seeing this behavior (ubuntu using prezto). I just cloned the repository. |
Hi @slester - Yeah, I haven't had a chance to figure out how to fix this while also not dramatically slowing down performance in I'm hoping to get time this week to take a look at it. |
No worries! If need be, I can have a look later today as well if you're open to a PR if I find a nice solution. |
@slester - I'm always open to PRs & contributions =) |
@agsimeonov @slester @christian-titze @qifei9 @machinshin Are you using the Trying to sort out what's going wrong, and I'm having trouble fixing this without negatively impacting the performance of powerlevel9k. |
@bhilburn I'm using the |
@bhilburn I am also using the |
Just to report, I am suffering from this bug too, tried both |
@bhilburn I am not using vi-mode distributed with Oh-My-Zsh I have my own personal ZSH dotfile configs which can be found here: I am using vi-mode distributed with ZSH directly by setting:
I then enable vi-mode in powerlevel9k using:
|
Thanks, @agsimeonov. So both the OMZ and built-in ZSH The only reason I haven't merged #320 is because it significantly slows down the prompt, and I haven't figured out a way to rectify that. If you look at the changeset, it basically requires regenerating the prompt three times for each actual rendering. Especially if you are in a git repository, this can be painfully long. Would folks be interested in using a special branch that has #320 merged? |
@bhilburn Unrelated to the issue, but related to the commit. That commit was referenced as a fix by removing the methods for the bug experienced here. Would that not also reintroduce that problem? That said, the issue I linked to I've read can be avoided by including |
So, what is the status of this issue ? And, what is the preferred fix ? Revert to v0.4.0, or use @agsimeonov's snippet ? Is there any fix in sight ? |
@dritter Great ! I used the above snippet (mixed it with what I already had). Works fine, I did not notice any slowdown, but looks kinda hacky. |
I've tried the fix, but it doesn't work on my oh-my-zsh installation. |
@eullerborges Do you mean, you've tried the PR #344 ? If yes, what exactly did not work? Just the |
@dritter Sorry, I hadn't tested the push request (I had to learn how to pull it). Vi_mode works perfectly on that push request. Sorry for the long response time. It's looking great so far, although I get some flickering on new lines. Thanks a lot! |
Is there a way that I can download and test this PR? |
@IQubic It depends how you installed powerlevel9k. If you did install it via
That should do it. To provide a little more background information: |
@dritter: When I try to pull that remote branch of yours, I get this error:
You know what's up with that? |
@IQubic Yes, sorry. I forgot one step. Before you can switch to that branch, you need to fetch the latest stuff from my remote.. I updated the tutorial. |
Ah, now it works. And it's quite snappy at that. |
hey @dritter as a heads up w/ that branch and zpresto powerline breaks :( |
Thx for letting me know @gone |
I tried the branch mentioned above due, and my experience was that it became noticeably slower and flickery. Just FYI. (thanks for powerlevel9k) |
@voiprodrigo Thanks for letting me know. As performance is always a matter of perception, could you be more specific about what is slow and your setup? Regarding your setup
Regarding the performance
Btw. I will add a debug script that can visualize the rendering times in the next couple of days. It would be super cool if you could run that. :) About the flickeringYes, this is the trade-off we have to do. Because there are some segments that might take some time until they gathered all necessary information to get rendered, we had to split up the rendering process so that each segment gets rendered individually. This process has some overhead (e.g. more disk I/O) That causes the flickering.. |
zsh 5.2 (x86_64-apple-darwin16.4.0) (installed with brew) I meant until the whole theme finishes rendering. After some more testing, I would revise the "noticeably" to "slightly", to be honest. And it depends where you are (or in other words, which segments are active in any given path). For example It actually seems to help a bit when git segment is active, but slightly slower otherwise. I'll run that debug script, no problem! |
Yep. As said, compared to the current 0.6.0 version, it does significantly more. But it shows its advantage in the extremes, e.g. when single segments are very slow. For instance, I have a git repo with 500.000 untracked files for testing purposes. On 0.6.0 what happens is that the entire prompt is not usable and the theme gets not rendered for almost a minute. On this branch, the prompt is usable, the theme gets rendered almost complete (except for the VCS segment that gets rendered when all informations are available). |
@voiprodrigo If you update your checkout, you'll get segment timings as promised. And I added The best way to use it:
(Sorry for the bad usability) In my case (in my huge repo) it looks like this (ignore the wrong name): |
Nice work, @dritter! 👍 |
I can confirm this issue on macOS Sierra 10.12.6, zsh version 5.3.1. I am not using a zsh framework. Let me know if I can provide any further debugging info. |
AFAICT this is just due to P9K removing the zle-keymap-select () {
zle reset-prompt
zle -R
}
zle -N zle-keymap-select From what I understand, this only incurs the extra prompt evaluation when the keymap changes. Is there a reason we can't add just this part back? |
This has been fixed since the merge of #740, and is continuing to get more changes in the |
Running on Mac OS X El Capitain 10.11.6 and vi_mode stopped working on both my machines all of a sudden today. I haven't done any updates on one my machine recently (that I recall). The other one I did an update through brew, but I can confirm that I haven't done the same on the other which is exhibiting the same issue. Everything else seems to work fine.
Edit:
Just logged in to a remote Linux (Ubuntu) machine I haven't updated or used in many many months, and vi_mode is gone on there too. What is happening?
The text was updated successfully, but these errors were encountered: