That horrible bash prompt PS1

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
held
Posts: 209
Joined: Sun Sep 26, 2021 2:18 pm
Has thanked: 27 times
Been thanked: 31 times

That horrible bash prompt PS1

Unread post by held »

All right now I'm not pointing fingers, because I made my share of MiSTakes along the way.
But something led /etc/profile to evolve into this:

Code: Select all

if [ "$PS1" ]; then
	if [ "`id -u`" -eq 0 ]; then
		export PS1='$(pwd)# '
	else
		export PS1='$(pwd)$ '
	fi
fi
Could we please change it into this, which does exactly the same thing:

Code: Select all

export PS1='$(pwd)\$ '
or even better for those with multiple MiSTer's (lucky bastards :D)

Code: Select all

export PS1='\u@\h:\w\$ '
Is there a place where we can submit these? because I can't find it.
pacoarcade
Posts: 72
Joined: Mon May 25, 2020 8:41 am
Has thanked: 75 times
Been thanked: 13 times
Contact:

Re: That horrible bash prompt PS1

Unread post by pacoarcade »

A pull request at github will work better. Anyway you can put that configuration into ~/.profile
jayp76
Posts: 30
Joined: Mon May 25, 2020 8:30 am
Has thanked: 1 time
Been thanked: 3 times

Re: That horrible bash prompt PS1

Unread post by jayp76 »

Something similar is already been done in the MiSTer github as part of the MiSTer scripts called make_linux_nice.

https://raw.githubusercontent.com/MiSTe ... ash_prompt

edit: Link corrected
held
Posts: 209
Joined: Sun Sep 26, 2021 2:18 pm
Has thanked: 27 times
Been thanked: 31 times

Re: That horrible bash prompt PS1

Unread post by held »

pacoarcade wrote: Fri Feb 04, 2022 8:43 am A pull request at github will work better. Anyway you can put that configuration into ~/.profile
Yes that worked thank you. I'm kinda allergic to Microsoft. So anyone already on there, feel free to submit this as your own.
jayp76 wrote: Fri Feb 04, 2022 9:06 am Something similar is already been done in the MiSTer github as part of the MiSTer scripts called make_linux_nice.

https://raw.githubusercontent.com/MiSTe ... ash_prompt

edit: Link corrected
Yes, Linux should be nice. I totally agree, but this lacks some elegance imo. Its a nice script though :D
Akuma
Posts: 138
Joined: Sat Dec 11, 2021 9:50 pm
Has thanked: 24 times
Been thanked: 45 times

Re: That horrible bash prompt PS1

Unread post by Akuma »

held wrote: Sat Feb 05, 2022 2:01 pm
pacoarcade wrote: Fri Feb 04, 2022 8:43 am A pull request at github will work better. Anyway you can put that configuration into ~/.profile
Yes that worked thank you. I'm kinda allergic to Microsoft. So anyone already on there, feel free to submit this as your own.
Pull request submitted
Post Reply