Skip to content

Conversation

@jandamm
Copy link

@jandamm jandamm commented Aug 12, 2021

I've tested this with the powerlevel10k prompt which needed some special handling.
Depending on the plugins loaded in the zshrc this might also have some unwanted side effects.

I've tested this with the powerlevel10k prompt which needed some special
handling. Depending on the plugins loaded in the zshrc this might also
have some unwanted side effects
@Valodim
Copy link
Owner

Valodim commented Aug 17, 2021

phewww. zsh env files do really arbitrary stuff, we can't hope to reliably deal with that in the general case. the "for powerlevel10k we'll need to disable the prompt twice" confirms this, it's extremely likely that there will be quirks for other configurations as well. I don't think this is a good change in default behavior.

As an alternative, how about a parameter that allows sourcing a file? That way the user could explicitly load a file, preferably one with function definitions but no other side effects, and get completions for them that way.

@jandamm
Copy link
Author

jandamm commented Aug 17, 2021

Yes, dealing with the zsh env something will probably go wrong.

But using zpty z zsh -f -i and zpty -w z source ~/.zshrc wouldn't work for me not even with my additions (because of said prompt).
And I'm sure this is something someone would try.

Another issue at least I'd come across is loading some kind of completions (zsh-users/zsh-completions for example) in the .zshrc where I also load powerlevel10k.

As for the second disabling of the PROMPT - this is actually incorrect. It just needs to be disabled before the init script. So the init script could drop the first line.

Since capture.zsh ~/.zshrc wouldn't work what about let g:zshCompletionLoadFullEnv = v:true which would then enable the new behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants