acomagu / fish-async-prompt

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

Issues with making other funcs async #51

Closed alyyousuf7 closed 2 years ago

alyyousuf7 commented 3 years ago

While trying to figure out how to use fish-async-prompt, I found a bug in the code which was preventing me to be able to create a custom async function, other than fish_prompt and fish_right_prompt.

https://github.com/acomagu/fish-async-prompt/blob/master/conf.d/__async_prompt.fish#L104 Hint: Wrongly placed $ when testing for existence.

After removing the extra $, the wheel started rolling but hit another bump and I can't figure out how to fix it.

I'm trying to execute the example where _git_branch_name is made async in README.

I get the following error:

fish: Unknown command: _git_branch_name
fish:
    _git_branch_name | read -z prompt
    ^

UPDATE: I was able to fix the Unknown command issue. It was a mistake from my side, or probably the way Fish v3.2.1 works. I had to create a separate file for the other function: _git_branch_name.fish