3 ms·
Notes: * As an idea, this is excellent. It's intuitive to use and provides full instructions on how to implement * Putting an element in any other position th
by Zhyl 5y ago
Notes:
* As an idea, this is excellent. It's intuitive to use and provides full instructions on how to implement
* Putting an element in any other position than the end of the prompt is fiddly.
* I'd love for the option to to be able to colour elements.
* More advanced or exotic element types such as Git Branch would be excellent (Not sure if Bash supports this, but I've seen it in some shells)
- phit_ 5y agodouble click an element to change the color
- Zhyl 5y agoAha! Thank you!
- dopidopHN 5y agoBash do support git branch name and whatnot. That what got me into PS1 customization.
- dolmen 5y agoSee also: * LiquidPrompt [0] (I'm a former maintainer) * angel-PS1 [1]: my pet project. Shell prompt code is generated at startup time from Perl code, and uses a Perl angel (not daemon) to get system information. [0] https://github.com/nojhan/liquidprompt https://github.com/nojhan/liquidprompt [1] https://github.com/dolmen/angel-PS1 https://github.com/dolmen/angel-PS1
- Jenk 5y agoFor the manual approach, git provides a shell script to generate the env var __git_ps1 for this very purpose.[1] [1]: https://git-scm.com/book/id/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash https://git-scm.com/book/id/v2/Appendix-A%3A-Git-in-Other-En...
- dom111 5y agoI've shared it elsewhere too, but I made something similar a few years ago which provides what you were after: https://dom111.github.io/bash-ps1/ https://dom111.github.io/bash-ps1/
- Rayhem 5y agoThere's one prompt in ZSH, the adam2 prompt[1], that I completely fell in love with due to the automatic horizontal rule since it makes tracing histories so much easier when dealing with long-scrolling outputs. I've never been able to find a similar feature in another prompt/shell, nor have I had the inclination to try and replicate it, but I'd be much more inclined to switch shells/try new prompts if that were available. [1]: https://imgur.com/1X9bY8X https://imgur.com/1X9bY8X
- indianboy42 5y agoThe tide prompt for fish has an option to add a horizontal rule and spaces between each command