Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 35122 - no nice prompt in terminals in X (when using bash at least)
Summary: no nice prompt in terminals in X (when using bash at least)
Status: RESOLVED DUPLICATE of bug 26952
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-05 02:26 UTC by Jaco Kroon
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2003-12-05 02:27:00 UTC
When installing a new system the prompt inside terminals in X seems to be broken.

It seems that /etc/profile does not gets sourced, or /etc/profile does not work
correcty.

We've seen this on three machines now (ok, one of those three was cast on a lab
of 40 machines or so but I'll only count that as one).  The first of these was
set up around 20th september.  The other two was set up in the last three weeks.

Reproducible: Always
Steps to Reproduce:
1.  Install a new system
2.  Make sure X is installed and set up
3.  Start a terminal once logged into X

Actual Results:  
The PS1 variable is not set when firing up a terminal

Expected Results:  
The PS1 variable should have been set.

No way I'm reading the info from one screen to the other ...  not relavent anyway.

There are a few possible fixes

1.  All terminals should start the shell as a login shell (probably not what we
    want).  /etc/profile only gets sourced for login shells.

2.  PS1 variable should rather be set in a global bashrc type thing
    (/etc/bashrc?) which gets sourced every time bash starts up.

3.  Implement a better test for bash.  For example, afaik terminals use
    /etc/passwd to determine what shell to fire up.  Then perhaps /etc/profile
    should rather check what user is sourcing /etc/profile, check what shell
    user is using and if it is bash set PS1 (also a check whether /bin/sh points
    to /bin/bash should be made).

4.  If all else fails, just put it into the /etc/skel/.bashrc file and those
    unlucky few who have caught the problem from a clean install can simply
    fix our's manually (or by using a dist system for those system admins
    who have hundreds of users ...)

Of all these option 3 seems to be the hardest, but looking at other discussions
going on, might for now be the best.  There also seems to be moves to creating
the /etc/bashrc type thing, which in the long run would be the best option
if you ask me.

I've just checked and the machines we have that works as expected doesn't
source /etc/profile when the terminal starts up either.  PS1 is however set
correctly, neither does the check in /etc/profile differ.  Could it be that
it does get set but that somewhere along the line whilst X starts up the
environment gets send to /dev/null? On those machines that does not work PS1
is set to '\s-\v\$ ', which to me indicates that some process/script somewhere
is changing PS1.

All this is mostly speculation but it would be appreciated a lot if this can
be sorted out asap.
Comment 1 Tavis Ormandy (RETIRED) gentoo-dev 2003-12-05 02:42:46 UTC
echo 'XTerm*loginShell: true' > ~/.Xdefaults

*** This bug has been marked as a duplicate of 26952 ***