acomagu / fish-async-prompt

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

Is it possible to support spinner? #46

Closed edouard-lopez closed 3 years ago

edouard-lopez commented 3 years ago

I created a repo with some spinner presets but can't get them to behave in the same way as when called directly. Indeed only the last character is visible.

Is the feature possible?

acomagu commented 3 years ago

The loading indicator function is executed at the foreground process. It means that the function is not asynchronous. So loading indicators can't be updated/animated, currently.

To implement spinner or something other animated indicator, we need to spawn another process to update it asynchronously. I feel it's too complicated/troublesome compared to the benefits. I'm sorry.

(But I'm glad if I can see the fork/pull supporting it. I could accept it if it is easier than I'm considering)