Live data from Hacker News

Bash PS1 Generator

bashrcgenerator.com

71–80 of 146 posts

Re: Bash PS1 Generator

#74
post #27
post #8

Earlier quoted context omitted.

It's too bloated. It has all kinds of built-in stuff with ugly defaults instead of just providing a framework with plugins.

If you like framework and plugins, try my own angel-PS1. https://github.com/dolmen/angel-PS1

Great job! Thank you!

Re: Bash PS1 Generator

#75
post #22
post #20

Earlier quoted context omitted.

It can be configured and the default has to be something. The main problem is that it’s just too slow, at least in my experience. Even stripped of some bloat it can take >1s to get the prompt printed. Not worth it, at all.

This has not been my experience at all. Then again, I only use 5 of all the plugins available.

Same experience. It also hurts me that support for so many things is baked-in!

Re: Bash PS1 Generator

#76

I've been using this for years (output of 'echo $PS1' ): [\e[1;33m\u\e[1;32m@\e[1;31m\H \e[1;36m\t\e[0m] [\e[1;35m\w\e[0m](\e[1;32m\#\e[0m )\n$ which presents as: [User@HOST 10:21:07][~](2) $ (Username, hostname, 24 hour local time, CWD, history count, newline, prompt) More detail from my .bashrc: # Define some colors first: red='\e[0;31m' RED='\e[1;31m' blue='\e[0;34m' BLUE='\e[1;34m' cyan='\e[0;36m' CYAN='\e[1;36m'…

What do you use the history count for?

Re: Bash PS1 Generator

#77

What is the best way to have the long directory line above the prompt? Using PS2 or PS3?

Something like "\w\n\$ " should work; mine is more complex by the idea holds, you can have a \n in your PS1 just fine.

Re: Bash PS1 Generator

#78
post #27
post #8

Earlier quoted context omitted.

It's too bloated. It has all kinds of built-in stuff with ugly defaults instead of just providing a framework with plugins.

If you like framework and plugins, try my own angel-PS1. https://github.com/dolmen/angel-PS1

Contrary to Starship, angel-PS1 gets all static information at startup time (ex: hostname, username) and rebuilds only the dynamic information. And for that dynamic information it uses an angel companion instead of forking and loading the configuration file for every prompt display.

Re: Bash PS1 Generator

#80

I've been using this for years (output of 'echo $PS1' ): [\e[1;33m\u\e[1;32m@\e[1;31m\H \e[1;36m\t\e[0m] [\e[1;35m\w\e[0m](\e[1;32m\#\e[0m )\n$ which presents as: [User@HOST 10:21:07][~](2) $ (Username, hostname, 24 hour local time, CWD, history count, newline, prompt) More detail from my .bashrc: # Define some colors first: red='\e[0;31m' RED='\e[1;31m' blue='\e[0;34m' BLUE='\e[1;34m' cyan='\e[0;36m' CYAN='\e[1;36m'…

I usually place the time at the beginning. Another thing to place at the beginning is a (red) exit code of the last command, when that code is not 0.
Post reply on HN