Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 503068 - app-shells/bash - sane bash defaults
Summary: app-shells/bash - sane bash defaults
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2014-02-28 17:30 UTC by three sixes
Modified: 2014-07-28 11:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

bashrc.patch (bashrc.patch,925 bytes, patch)
2014-02-28 17:31 UTC, three sixes
Details | Diff
bash_logout.patch (bash_logout.patch,319 bytes, patch)
2014-02-28 17:34 UTC, three sixes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description three sixes 2014-02-28 17:30:12 UTC
app-shells/bash-4.2_p45 is shipping with bad default configs.

Reproducible: Always
Comment 1 three sixes 2014-02-28 17:31:50 UTC
Created attachment 371442 [details, diff]

patch for /etc/bash/bashrc
Comment 2 three sixes 2014-02-28 17:34:41 UTC
Created attachment 371444 [details, diff]

patch for sane /etc/bash/bash_logout
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-28 18:16:59 UTC
Comment on attachment 371442 [details, diff]

>--- bashrc	2014-02-28 07:18:38.079771357 -0500
>+++ bashrc.sane	2014-02-28 07:23:27.579565292 -0500
>@@ -60,11 +60,17 @@
> 	fi
> 	if [[ ${EUID} == 0 ]] ; then
>-		PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
>+		PS1='\[\e[01;31m\]\u@\h\[\e[01;31m\] [ \[\e[0m\]\w\[\e[1;31m\] ] \$\[\033[0m\] '
> 	else
>-		PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
>+		PS1='\[\e[01;32m\]\u@\h\[\e[01;32m\] [ \[\e[0m\]\w\[\e[1;32m\] ] \$\[\033[0m\] '

How is that more sane, other than that PS1 now looks like it does on random other distros?

> 	fi
>+	alias sudo='sudo '

Oh, sudo is installed? And this saves you from typing an extra space when you were already going to type a tab? Or how would that work?

>+	alias rm='rm -i'
>+	alias cp='cp -i'
>+	alias mv='mv -i'

Wrong distro again?

>+	alias ping='ping -c 5'

And what if you then want to run ping without that limitation?

>+	alias emerge='emerge --ask-enter-invalid -av'

emerge is installed? And we all want this as default?

>@@ -72,9 +78,9 @@
> else
> 	if [[ ${EUID} == 0 ]] ; then
> 		# show root@ when we don't have colors
>-		PS1='\u@\h \W \$ '
>+		PS1='\u@\h [ \w ] \$ '
> 	else
>-		PS1='\u@\h \w \$ '
>+		PS1='\u@\h [ \w ] \$ '

The other distro again?

Really, none of these changes make bashrc more sane - most of them might be convenient for you, in which case you can change it locally just fine.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-28 18:17:35 UTC
Comment on attachment 371444 [details, diff]

>--- bash_logout	2014-02-28 07:18:37.916750638 -0500
>+++ bash_logout.sane	2014-02-28 07:13:01.419983629 -0500
>@@ -3,7 +3,7 @@
> # This file is sourced when a login shell terminates.
> # You may wish to clear everyone's screen when they logout.

The distro default isn't satisfactory?
Comment 5 three sixes 2014-03-01 01:32:56 UTC
to ping with out limitation

$unalias ping

sudo is for sudo tab completion, sudo will become more important in a bit in gentoo.

-i ask before doing potentially damaging file operations.

yes you want emerge to ask by default, and do nothing unless explicitly told y Y yes or YES....

clear?  mysql is known to leave plaintext passwords in consoles.  im sure there are others.

the ps1 W to w is not a mistake and is a legitimate bug in the current bashrc resulting in incomplete path output.

>-		PS1='\[\033[01;31m\]\h\
>+		PS1='\[\e[01;31m\]\u@\h\

results in "localhost" instead of "root@localhost"

they may be convenient to production server admins, vps defaults, new users etc....  ps1 mirrors LFS but thats just personal preference, the others should be addressed.

just because you don't notice that its broken does not mean its not.
Comment 6 SpanKY gentoo-dev 2014-03-09 07:21:17 UTC
i might add the \u option to the default PS1, but Jeroen is 100% right about the rest -- they have no business being anywhere near distro-wide defaults.
Comment 7 three sixes 2014-03-11 01:18:55 UTC
(In reply to SpanKY from comment #6)
> i might add the \u option to the default PS1, but Jeroen is 100% right about
> the rest -- they have no business being anywhere near distro-wide defaults.

W to w....  see funtoo duplicate bug.

this is 100% my PRIMARY problem with the distro wide bashrc.......
Comment 8 SpanKY gentoo-dev 2014-03-11 06:21:37 UTC
(In reply to three sixes from comment #7)

no idea what you're talking about.  your response (and that linked bug) contain no real details beyond what you've already provided here.

simply because your personal choice of default settings doesn't line up with everyone else in the world doesn't mean everyone else in the world is doing it wrong.