Page 1 of 1

That horrible bash prompt PS1

Posted: Fri Feb 04, 2022 8:21 am
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.

Re: That horrible bash prompt PS1

Posted: Fri Feb 04, 2022 8:43 am
by pacoarcade
A pull request at github will work better. Anyway you can put that configuration into ~/.profile

Re: That horrible bash prompt PS1

Posted: Fri Feb 04, 2022 9:06 am
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

Re: That horrible bash prompt PS1

Posted: Sat Feb 05, 2022 2:01 pm
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

Re: That horrible bash prompt PS1

Posted: Sat Feb 05, 2022 2:33 pm
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