-
Notifications
You must be signed in to change notification settings - Fork 1
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
git module in scrollback theme #5
Comments
The scrollback theme does not use previously computed values because its configuration can be completely unique from the main theme. The cached value for the git output would be generated based on the main theme's configuration, so it would not work well if someone wished to have it display differently from the main theme's configuration. The cache key for each module also contains the theme name and information about where that module is located on the prompt, which wouldn't match up with the scrollback theme. What I could do for this is to implement an additional more generic caching method for scrollback themes to pull from on async modules. It would require each async module to have additional code to populate that cache and possibly an additional function to parse it if needed. This would be the best way to keep added overhead down while still providing the same flexibility and configuration options to scrollback themes. For now I have no immediate plans to implement that, but if this issue gets more attention from others I can make it a priority. I could also just decide to do it one day if I don't have a lot going on, but I've been pretty busy lately so that might not happen anytime soon. |
Thanks for this detailed explanation. Maybe you can add into the readme for each module if it can be used in scrollback theme as an indication (and point to this issue) for explanation? Side question: If I want only local-branch and commit-hash in scrollback theme, do you see a way to achieve this, like a synchronous git-lite module? |
The simplest way to get that would be to copy the existing git module: https://github.com/mjrafferty/apollo-zsh-theme/blob/master/modules/__apollo_git_load Say we call the new module sync_git, you can copy the above file into a file called You'd then need to make the following changes:
This should give you most of the same functionality as the normal module, and as long as you're only using the commit hash and local branch it shouldn't be too bad on performance. The downside here will be with stale cache on commit or branch change. The cache key uses the current working directory and won't update as long as cache exists. You have a few options for this:
|
It seems the git module provides no output at all in scrollback theme.
As noted in https://github.com/mjrafferty/apollo-zsh-theme/blob/master/docs/theme_guide.md#scrollback-theme
Although I expected it to reuse previously computed values. Is it possible?
The text was updated successfully, but these errors were encountered: