agnoster / agnoster-zsh-theme

A ZSH theme designed to disclose information contextually, with a powerline aesthetic
3.95k stars 583 forks source link

Prompt just says "$(prompt_agnoster_main)" instead of looking cool #35

Open Djaler opened 7 years ago

Djaler commented 7 years ago

image

belak commented 7 years ago

How are you initializing the prompt? If you use prompt agnoster this should work just fine. If you're calling prompt_agnoster_setup directly it may not work. The problem lies with the prompt_subst option, which should always be set. Using prompt agnoster uses a little wrapper function to grab the prompt_opts which are set in the setup function... calling the setup function directly may cause those options to be ignored.

Djaler commented 7 years ago

I just used zgen load agnoster/agnoster-zsh-theme agnoster.zsh-theme

belak commented 7 years ago

Ah, then adding something like https://github.com/sindresorhus/pure/blob/4cdd0cf/pure.zsh#L434 to agnoster may be a better fix

paxet commented 6 years ago

I'm migrating to zgen from OMZ and want to use agnoster theme too. But without loading oh-my-zsh system. Loading agnoster like Djaler said: zgen load agnoster/agnoster-zsh-theme agnoster.zsh-theme Can confirm that including the referenced line by belak solves the problem.

Landed a Pull Request: https://github.com/agnoster/agnoster-zsh-theme/pull/60

apjanke commented 4 years ago

Yep. You need to setopt promptsubst in your zsh configuration. If you're running Agnoster inside Oh My Zsh (which it seems primarily designed for), Oh My Zsh will do that for you. If you're running Agnoster on its own, you must do this manually.

As a workaround until one of these PRs lands, just stick an unconditional setopt promptsubst in your ~/.zshrc file, and Agnoster will work everywhere. (You highly likely want this turned on everywhere.)

apjanke commented 4 years ago

See @qoomon's PR #114 for an alternate simple fix. Let's decide which approach is better. Or maybe it should just do a simple setopt promptsubst to keep our option-setting to a minumum?