Closed Grafikart closed 4 years ago
@Grafikart Hey, thank you for using the project and for your interest in making it better! This is a great idea and I thought about it myself. The problem is that as far as I know fish doesn't support running multiple processes in parallel. There are a few hacks I can think of so it might be worth a shot.
Feel free to give it a try. Whenever I find the time I will also work on it, we can plan for the 2.1 release next year.
The async git functionality is one of the things that really drew me to the original pure back when I used zsh. Would be amazing to see it in this project.
Until this happens, could we get an option to disable the git features? I'm experiencing slowdowns due to pure, and this is likely the cause.
I can give it a shot, though I don't have much experience with this sort of thing so the quality of my contribution might not be great.
@tkadur good idea! I would be interested in such a feature too. I manage my git repos separately, the CLI prompt is more of a visual cue or quick reminder anyway.
I've since found and switched to a different port of the pure theme — https://github.com/vkovtash/pure. It took a little tweaking to get it working but it may be worth looking into for ideas about async git functionality.
EDIT: I ended up creating my own theme based on that other project + adding some ideas from here + fixing some performance issues - https://github.com/MaxMilton/pure
@MaxMilton Would you be willing to help us add async support to this project? I'd love to join forces to get this in. Your effort would be much appreciated (already is!).
Just a small warning about the port. If you use an passphrase for your SSH key, it will ask you the passphrase when reaching a directory with a remote repository (passphrase that you won't be able to enter since it's requested by the theme process).
I'll try to implement it. You can assign me.
@schrodincat I pinged @rafaelrinaldi to do it, I don't enough privileges on the repo.
@schrodincat @edouard-lopez I am not sure what else I can do? I gave all the admins full privilege on GitHub as far as I can tell. Help?
@schrodincat sorry for the delay, I'm working on #96 to add tests prior to new PRs
@tkadur adding a feature flag to disable git
is a good idea as async support is more complex.
The feature can be implemented by:
pure_enable_git
options in conf.d/pure.fish (default to true
)@MaxMilton Thanks for the link, might help implementing async support.
adding a feature flag to disable git is a good idea
It'll be quite a while before we add git async (I haven't even started to work on it yet) so it makes perfect sense
The acomagu/fish-async-prompt look quite promising to this feature.
As discussed in #74 we postponed the integration of this feature after the release of 2.0.0
.
In the meantime, PR are welcome so we can discuss code and move forward :zap:
Anyone checking this issue in 2020. There's a simple solution currently using https://github.com/acomagu/fish-async-prompt
fisher add acomagu/fish-async-prompt
and put this in your config.fish
(or anywhere you want)
set -g async_prompt_functions _pure_prompt_git
@NovaDev94 @gpanders thanks for the link! I’m going to look into this project and try to reimplement it manually for Git part of pure
, since we need to support Oh My Fish!, manual install methods and cannot use dependencies via fishfile
.
since we need to support Oh My Fish!, manual install methods and cannot use dependencies via fishfile.
Of course, I should have thought of that. I got caught up in my own use case.
@NovaDev94 solution is quite simple and configuration only, so nothing to add in pure.
I'm closing
@NovaDev94 solution is quite simple and configuration only, so nothing to add in pure.
Could be helpful to add this solution to the configuration section of the README.
@bdarcus would you care submitting a pull-request ?
I did consider that, but wasn't sure where best to put it.
But I can also add one, and you can adjust.
First I want to thanks you for this prompt, it looks really nice. But I have one issue when working on very slow hard drive, the shell freezes when entering a new directory (when pure tries to fetch git informations). Do you think it would be possible to retrieve git information asynchronously like the original pure does ?
I have no knowledge on how prompt works, so feel free to close this issue if this change requires a tons of work ;)