Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 149473 - Revert to former $PS1 style
Revert to former $PS1 style
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: setup (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-02-23 09:32 EST by Andreas Thienemann
Modified: 2014-03-16 22:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-02-24 14:30:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch reverting back to the former bahaviour (1.00 KB, patch)
2005-02-23 10:20 EST, Andreas Thienemann
no flags Details | Diff

  None (edit)
Description Andreas Thienemann 2005-02-23 09:32:24 EST
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

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 10:20:24 EST
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 10:23:07 EST
Can you explain in a bit more detail why you think this change is needed?  Thanks.
Comment 3 Andreas Thienemann 2005-02-23 10:35:12 EST
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

Alex describes it correctly IMHO: It's irritating.
People are used to if for several years.
Comment 4 Tim Waugh 2005-02-23 11:39:38 EST
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 09:37:23 EST
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 14:30:44 EST
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 16:11:22 EST
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-24 23:34:10 EST
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 17:27:22 EST
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?

Note You need to log in before you can comment on or make changes to this bug.