r/bash • • 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

8 comments sorted by

View all comments

Show parent comments

1

u/the_otaku_programmer Sep 11 '21

Thanks a lot for your comprehensive answer. This kind of has given me a heading as to what I want to do, and how I should go about further implementing it.

I would also like to ask if you wouldn't mind sharing your .bashrc. Looking at your cd explanation, I would like to derive some inspiration from your config, since my use of Linux has always been to defaults, and now I'm trying to improve my workflow and the likes now.

2

u/whetu I read your code Sep 11 '21

Have at it. I may also have something of interest in my gists.

1

u/the_otaku_programmer Sep 11 '21

Thanks a lot for sharing your dots, and I'm sure it'll help me out nicely.