Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

incompatibility with autosuggestion plugin #281

Closed
PiQuer opened this issue Jun 22, 2016 · 17 comments
Closed

incompatibility with autosuggestion plugin #281

PiQuer opened this issue Jun 22, 2016 · 17 comments

Comments

@PiQuer
Copy link

PiQuer commented Jun 22, 2016

Hi Ben,

thanks for this awesome theme!

I have encountered an incompatibility with the zsh-users/zsh-autosuggestions plugin. Is there anything which might be done on the side of powerlevel9k? Maybe you have an idea what the cause could be?

Cheers!
Raimar

@bhilburn
Copy link
Member

Hi @PiQuer - Thanks for being an awesome user! We also have a number of fantastic devs that help make this theme great, like @dritter, @rjorgenson, and many others.

And whoa, weird bug. So when using powerlevel9k, and only when using powerlevel9k, the terminal doesn't remove the rest of the printed prompt? I wouldn't have thought that we had anything to do with this, but your bug report over in the zsh-users repo is pretty thorough, and this may be related to #280 somehow.

@dritter - Do you have any thoughts, here? I'm trying to think about what we are doing that might cause this, and I'm honestly not sure. We don't prevent redraws on a new prompt render.

@PiQuer
Copy link
Author

PiQuer commented Jun 30, 2016

Yes, weird indeed. But I would think it is the combination of autosuggestion and powerlevel9k. From a fresh start zsh -f, loading autosuggestion alone, everything is still fine. Then after loading powerlevel9k the bug is triggered. I also tried to load the plugins the other way around, same result.

Thanks for having a look!

@bhilburn
Copy link
Member

bhilburn commented Jul 6, 2016

@PiQuer -

Can you share your powerlevel9k config? Also, what release / branch are you using?

@bhilburn
Copy link
Member

Hi @PiQuer - I just wanted to ping you on which release / branch you are using, and if you could share your config?

@PiQuer
Copy link
Author

PiQuer commented Jul 13, 2016

Sorry! I am using the master branch, currently on cef8c65. Here is my config of powerlevel9k:

export TERM="xterm-256color"
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status load ram swap time vi_mode)
antigen theme bhilburn/powerlevel9k powerlevel9k

However, the problem also occurs with the default configuration, starting with zsh -f and only sourcing the powerlevel9k theme together with the autocompletion plugin.

@retnuh
Copy link

retnuh commented Jul 20, 2016

Does powerlevel9k override the accept-line widget, or rebind enter key or whatever? I was having a similar problem with autosuggest; it appears to have a special variable, ZSH_AUTOSUGGEST_CLEAR_WIDGETS that contains widgets that it will clear the autosuggestion for when it is called. If you rebind the enter key to a different widget, then autosuggest won't know to clear stuff properly.

I would argue that's a bug in autosuggest, but you may be able to come up with a workaround temporarily.

@bhilburn
Copy link
Member

@retnuh - Hm, no, we don't do any key rebindings in the code. That said, over in #263, @mafredri pointed out that we are overriding certain zle-line-* functions, and I'm wondering if that's actually affecting this, somehow. I plan to dig into it this weekend - hopefully I can find something.

@wadkar
Copy link
Contributor

wadkar commented Jul 23, 2016

👍
Let me know if you want any help with this @bhilburn . I have the same problem.

@bhilburn
Copy link
Member

@retnuh, @PiQuer, @wadkar - Hey all, would you mind giving the below branch a shot and let me know if it changes anything for you?

https://github.com/bhilburn/powerlevel9k/tree/removing-zle-funcs

@PiQuer
Copy link
Author

PiQuer commented Aug 15, 2016

Thanks, I will test this branch soon.

@PiQuer
Copy link
Author

PiQuer commented Aug 20, 2016

Yes, this branch fixes the issue for me. Thanks!

@retnuh
Copy link

retnuh commented Aug 25, 2016

@bhilburn I don't actually use powerlevel9k but had come across a similar issue with my own setup, and thought I'd chime in my own experiences...

@wadkar
Copy link
Contributor

wadkar commented Aug 26, 2016

@bhilburn sorry I have been busy with work off late. Will give it a shot over the weekend and report back here.

@strayer
Copy link

strayer commented Aug 26, 2016

Didn't comment on this issue before, but the problem also disappeared for me with the removing-zle-funcs branch. Been using it since the 17th without any problems!

Just to be safe:
zsh 5.2
powerlevel9k 92ff274
zsh-users/zsh-autosuggestions@62cdba4

Tested on Linux via SSH and on macOS 10.11.6 in iTerm2 3.0.8

@bhilburn
Copy link
Member

@PiQuer @strayer - Awesome! I'm so happy to hear that fixes the problem.

I have merged this fix into next as of 520eed1. Please checkout the latest next, give it a shot, and let me know if you see any issues!

@alecgerona
Copy link

alecgerona commented Aug 20, 2018

People still having issues with this, remember that your terminal font colors might hide the otherwise perfectly fine autosuggest plugin. Scratched my head for a good long while there.

@Haozhe321
Copy link

from https://medium.com/@Clovis_app/configuration-of-a-beautiful-efficient-terminal-and-prompt-on-osx-in-7-minutes-827c29391961,

if the auto suggestions do not appear to show, it could be a problem with your color scheme. Under “iTerm → Preferences → Colors tab”, check the value of Black Bright, that is the color your auto suggestions will have. It will be displayed on top of the Background color. If there is not enough contrast between the two, you won’t see the suggestions even if they’re actually there..

Hope this helps

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants