acomagu / fish-async-prompt

Make your prompt asynchronous to improve the reactivity.
MIT License
389 stars 22 forks source link

Loading indicator #43

Closed andreiborisov closed 3 years ago

andreiborisov commented 3 years ago

Would it be possible to print some sort of loading indicator instead of the previous prompt before printing a new one?

acomagu commented 3 years ago

Like this? https://user-images.githubusercontent.com/1362750/102706844-bf9c6900-42d8-11eb-9858-fb73cc380071.mp4

andreiborisov commented 3 years ago

Yes🙌🏻

andreiborisov commented 3 years ago

It would be even cooler to have some simple animation, but I assume it's a nightmare to implement if even possible.

acomagu commented 3 years ago

Yes I guess implementing animation will be hard because extra processes must be spawned. But I may try because I think it's cool feature also.

But for now, I'll implement the non-animated loading indicator. Thank you for good suggestion!

andreiborisov commented 3 years ago

Thank you for an awesome tool you made🙏

andreiborisov commented 3 years ago

Do you mind making the loading indicator string customizable via a variable?

acomagu commented 3 years ago

Yeah, I'll make it customizable by defining a function.

function fish_right_prompt_loading_indicator
    echo (set_color brblack)' … '(set_color normal)
end
acomagu commented 3 years ago

Finally it's supported at 01741b0! Thank you!