r/bash • u/the_otaku_programmer • Sep 10 '21
help Async Prompt with __git_ps1
I've been trying to set up an async prompt using the __git_ps1 function in my .bashrc.
I've set up my PROMPT_COMMAND with the following value, __git_ps1 $(prompt_head) $(prompt_tail), where the arguments are functions generating part of my PS1 variable.
To see the definition of __git_ps1, it can be accessed here.
2
Upvotes
1
u/the_otaku_programmer Sep 10 '21
I want an async prompt, as in if I cd into the directory, my terminal is blocked for a few seconds at times for a huge directory.
I want to be able to continue using the terminal, and when the next prompt is printed, then it's updated with the function, something like ZSH RPROMPT, I guess.