Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the agnoster theme for more configurability #3434

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Kilobyte22
Copy link

The agnoster theme now supports:

  • Setting color for all kinds of elements, by setting an appropiate config variable to the color name in your zshrc. A full list of colors can be found in themes/agnoster.zsh-theme. Example:
AGNOSTER_GIT_DIRTY_BG=red # Set the git prompt background color to red for dirty repos
  • Allowing to separate the git root and the relative path in your prompt by setting AGNOSTER_GIT_INLINE to true. You will then have a segment for the git root (ie. ~/.oh-my-zsh) followed by the existing git branch segment (ie. master) and finally the relative directory path (ie. themes)
  • By setting AGNOSTER_STATUS_RETVAL_NUMERIC to true, The return value in the status prompt will become a number instead of a cross.

This will not affect people using this theme, as with default options, the theme behaves exactly as before this change.

The agnoster theme now supports:

* Setting color for all kinds of elements, by setting an appropiate config variable to the color name in your zshrc
  Example: AGNOSTER_GIT_DIRTY_BG=red # Set the git prompt background color to red for dirty repos
* Allowing to separate the git root and the relative path in your prompt by setting AGNOSTER_GIT_INLINE to 'true'
  You will then have a segment for the git root (ie. ~/.oh-my-zsh) followed by the existing git branch segment (ie. master) and
  finally the relative directory path (ie. themes)
* By setting AGNOSTER_STATUS_RETVAL_NUMERIC to 'true', The return value in the status prompt will become a number instead of a cross.
@robbyrussell robbyrussell added Area: theme Issue or PR related to a theme Status: testers needed Pull Requests that are waiting for testers to merge labels Feb 22, 2015
@ssgelm
Copy link

ssgelm commented Apr 12, 2015

This works great for me! Any chance of it getting merged?

@Kilobyte22
Copy link
Author

I really hope it does, i did find a bug though which i'll fix in a bit. (I currently have not much time): Currently the Inline Git setting breaks inside bare repos. I will look into that when i have time. (Which should be within the next week)

@BrainBacon
Copy link

Wonderful changes! I'm definitely in support of this being merged.

@ssgelm
Copy link

ssgelm commented Jul 10, 2015

I have been using this for a few months without issue.

Up until now the agnoster theme with enabled inline git branch display did not work properly for bare repos.
This was caused by `git rev-parse --show-toplevel` returning empty string for bare repos. In that case it now uses the git directory as root.
Your bare repo should be displayed properly (although you usually won't really navigate through a bare git repo, this is nice to have.
@Kilobyte22
Copy link
Author

As promised, i fixed the issue with the inline git not working inside bare repos.

For some reason i forgot to save the file in my editor, leading to the code not working. Luckily i looked through the changed files on github again and i found this. This is what happens if you don't care to actually test your code for once
Due to some more lack of testing i totall missed that my earlier fix did not work. This is now really fixed. (i should not write code when tired.)
For some reason i forgot to save the file in my editor, leading to the code not working. Luckily i looked through the changed files on github again and i found this. This is what happens if you don't care to actually test your code for once
Due to some more lack of testing i totall missed that my earlier fix did not work. This is now really fixed. (i should not write code when tired.)
@Kilobyte22
Copy link
Author

Is there any chance of this ever getting merged?

Billy- added a commit to Billy-/agnoster-zsh-theme that referenced this pull request Jan 23, 2018
This is basically porting [this PR](ohmyzsh/ohmyzsh#3434) over to this repo. Would fix agnoster#30.
@mcornella mcornella added the Status: conflicts Pull Request that has conflicts with the master branch label Mar 24, 2019
@robbyrussell
Copy link
Member

⌛️ Apologies for delays on this. With the number of changes and popularity of this theme (despite not using it myself), I would like to see this get rebased, again. I'll keep an eye out for that and hopefully we can get that merged quickly!

@carlosala
Copy link
Member

Could we rebase this on top of master to review it properly? Thanks!

@carlosala carlosala self-assigned this Nov 4, 2022
@optimistic-updt
Copy link

any movements on this?

@carlosala
Copy link
Member

Hi! If someone is interested on it, could you rebase it on top of master, and open a new PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: theme Issue or PR related to a theme Status: conflicts Pull Request that has conflicts with the master branch Status: testers needed Pull Requests that are waiting for testers to merge
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

7 participants