agnoster / agnoster-zsh-theme

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

hide-status = 1 doesn't work for agnoster theme #27

Open RyanHuen opened 7 years ago

RyanHuen commented 7 years ago

I use the following command : git config --add oh-my-zsh.hide-status 1 and I check the config file: [oh-my-zsh] hide-status = 1

but when I enter that git repo ,it still show the status.

MichaelAquilina commented 7 years ago

This is probably something specific for oh-my-zsh. I opened a PR that will allow you to disable it though: https://github.com/agnoster/agnoster-zsh-theme/pull/40

apjanke commented 7 years ago

Yup, that's an Oh My Zsh feature that only works with OMZ themes that use OMZ's [git_prompt_info()])https://github.com/robbyrussell/oh-my-zsh/blob/1c958e02a5613a4312534b1afe9f9f8c4a0793c2/lib/git.zsh#L2-L9) function. (Or have been otherwise coded to respect it.)

You might want to add the ability to check a similar agnoster.hide-status git configuration variable in Agnoster as well, instead of just variables to globally disable segments of the prompt. The purpose of this config option isn't to disable the git status display globally, but to allow you to set it per-repo so you can turn off status checking on ginormous or network-filesystem repos where the git status command would take a long time to run and slow down your prompt.

Or I guess you could just piggyback off oh-my-zsh.hide-status. It's a bit of a branding wart, but the semantics are compatible with Agnoster.

(In a perfect world, we might have a generic git config --add shell-theme.hide-status 1 that we could all (OMZ, Agnoster, Prezto, Antigen) share. But that would take a conference committee to agree on a standard naming scheme.)

MichaelAquilina commented 7 years ago

I wasnt aware of this issue existing @apjanke, thanks for the insight. It seems like it might be worth another PR to fix that exact problem?

apjanke commented 7 years ago

Yeah, and I can take a stab at it.

Do you think it would be better to use a new agnoster.hide-status config, or reuse the oh-my-zsh.hide-status one, even though this isn't really OMZ?

On the upside, reusing the oh-my-zsh.hide-status one might make it easier to downstream changes to OMZ's version of Agnoster, which I bet is a major user base of Agnoster.

MichaelAquilina commented 7 years ago

do you think there would be any negative side effects from using oh-my-zsh.hide-status? (Apart from some confusion as to why its being used). I agree that being able to merge these ~upstream~downstream is a good side effect from taking this approach.

apjanke commented 7 years ago

I don't think so – I can't see any situation where a user would want to suppress the status in OMZ themes, but not in plain Agnoster.

Of course, organizationally, you run the risk of getting more OMZ bug reports accidentally filed against Agnoster now that the name oh-my-zsh is in its source code. Hmmm.

apjanke commented 6 years ago

Status update: sorry, I'm too busy with other stuff to make a go at this any time soon.