Bug 149473

Summary: Revert to former $PS1 style
Product: Red Hat Enterprise Linux 4 Reporter: Andreas Thienemann <andreas>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-24 19:30:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch reverting back to the former bahaviour none

Description Andreas Thienemann 2005-02-23 14:32:24 UTC
Description of problem:
After upgrading to RHEL4, the same "problem" as on FC3 appears:

The PS1 bash-prompt shows the following:
[root@build ~]# 

According to http://cnswww.cns.cwru.edu/~chet/bash/NEWS this is the normal
behaviour.

I would expect the prompt to show the previous look from RHEL3 and former Red
Hat Linux products:
[root@horscht root]#

The Homedir should not be abbreviated by a ~.

I'd like to see RH introduce either a bash patch which restores the former
behaviour or, which might be the more sensible choice, adapt the /etc/bashrc.

Comment 1 Andreas Thienemann 2005-02-23 15:20:24 UTC
Created attachment 111339 [details]
Patch reverting back to the former bahaviour

This is basically a rollback of the changes from bash-2.05b to bash-3.0, which
result in the "unwanted" transformation of \W

Comment 2 Tim Waugh 2005-02-23 15:23:07 UTC
Can you explain in a bit more detail why you think this change is needed?  Thanks.

Comment 3 Andreas Thienemann 2005-02-23 15:35:12 UTC
Well, it is not needed per se as it is "just" a cosmetic issue.

However, the prompt style for Red Hat Products since RHL 3.0.3 (first RHL I
installed) has always been "[root@localhost root]# ".
Having changed this to "[root@horscht ~]# " by an upstream decision may not be
considered important as it is, after all, just an appearance issue.

However, I much preferred the former style and thus would like to see it
restored, as do others, as can be seen on the Fedora Core list
https://www.redhat.com/archives/fedora-list/2004-December/msg02154.html.

Alex describes it correctly IMHO: It's irritating.
People are used to if for several years.

Comment 4 Tim Waugh 2005-02-23 16:39:38 UTC
You *could* achieve what you want like this:

export PROMPT_COMMAND="${PROMPT_COMMAND};"'export PWD_W=${PWD##/*/}'
export PS1='[\u@\h $PWD_W]\$ '

but I'll ask upstream for a better solution.

Comment 5 Tim Waugh 2005-02-24 14:37:23 UTC
The better solution is:

export PS1='[\u@\h ${PWD##/*/}]\$ '

/etc/bashrc is owned by the setup package.  Changing component and reassigning.

Comment 6 Bill Nottingham 2005-02-24 19:30:44 UTC
I don't think changing the upstream behavior of bash by changing the setup PS1
definition is really worth the effort.

Comment 7 Andreas Thienemann 2005-02-24 21:11:22 UTC
I can't follow you.
Changing the setup PS1 defintion to PS1='[\u@\h ${PWD##/*/}]\$ ' does change the
upstream behaviour how?

The aim is not making the upstream developer do "the right thing" but introduce
a sense of continuity with regard to the prompt-style.

Using above PS1 prompt does not even need a patch in bash.

Comment 8 Bill Nottingham 2005-02-25 04:34:10 UTC
Sorry; what I'm saying is that I don't think it's worth it to change PSx to work
around bash changes.

Comment 9 Andreas Thienemann 2005-02-25 22:27:22 UTC
Okay, I get you now.
However, how do you suggest a consistent looking prompt on the shell can be
achieved (by default, not by changing settings after the installation)?

As I wrote above, people are used to the style they have been using for quite
some years.
Therefore I do think it is diserable to keep the former prompt-style.
Whether this is achieved by patching the shell or by adapting some setup-scripts
is debatable.

I guess, changing the bashrc is the easiest way of reaching this aim.

Or is the consistent look of the prompt not an issue at all?