Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 23297 - baselayout 1.8.6.8-r1 breaks PS1 definition
Summary: baselayout 1.8.6.8-r1 breaks PS1 definition
Status: RESOLVED DUPLICATE of bug 26952
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 23554 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-22 17:20 UTC by Ryan Koski
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 Ryan Koski 2003-06-22 17:20:53 UTC
baselayout 1.8.6.8-r1 includes changes to /etc/profile that test to see if $TERM='dumb' 
before setting PS1.  Well, when logging into KDE 3.1.2 using KDM, apparently 
$TERM='dumb' at the time that /etc/profile is sourced.  When I start Konsole, my bash shell 
uses the default prompt.  If I modify /etc/profile as follows: 
 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
if [ `/usr/bin/whoami` = 'root' ] 
then 
        # Do not set PS1 for dumb terminals 
        if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ] 
        then 
                export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]' 
        fi 
        export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}" 
else 
       ################################## 
       # Test for borked baselayout upgrade 
       ################################## 
       export RKTEST=$TERM  
       # Do not set PS1 for dumb terminals 
        if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ] 
        then 
                export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]' 
        fi 
        export PATH="/bin:/usr/bin:${PATH}" 
fi 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
 
and then log back into KDE, when I echo $RKTEST at the shell prompt, RKTEST=dumb 
 
I'm assuming the baselayout maintainer is not a KDE person. =) 
 

Reproducible: Always
Steps to Reproduce:
1. emerge baselayout 1.8.6.8-r1 
2. Spend much time running etc-update 
3. Log out and log back into KDE 3.1.2 using KDM 
4. Start Konsole 
 
Actual Results:  
bash prompt uses bash default (bash-2.05b$) 

Expected Results:  
Use Gentoo default PS1 value from /etc/profile. 

Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) 
================================================================= 
System uname: 2.4.20-gentoo-r2 i686 Intel(R) Xeon(TM) CPU 1700MHz 
GENTOO_MIRRORS="http://gentoo.oregonstate.edu 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config 
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config 
/usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR_OVERLAY="" 
USE="x86 apm avi crypt cups encode gif jpeg libg++ libwww mikmod mmx mpeg ncurses 
nls png quicktime spell truetype xml2 xmms xv zlib gtkhtml gdbm berkdb slang readline 
arts aalib bonobo svga java guile X sdl gpm tcpd pam ssl python esd imlib oggvorbis gtk qt 
kde motif opengl ldap snmp -3dnow -gnome -oss acpi alsa apache2 cdr dga directfb dvd 
fbcon gtk2 imap matrox mozilla mysql pdflib perl prebuilt samba scanner smooth tiff" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-march=pentium3 -O3 -pipe" 
CXXFLAGS="-march=pentium3 -O3 -pipe" 
ACCEPT_KEYWORDS="x86" 
MAKEOPTS="-j3" 
AUTOCLEAN="yes" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="sandbox ccache buildpkg fixpackages"
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-06-22 21:13:13 UTC
You are calling Konsole with the '-l' switch (login shell) ?
Comment 2 Ryan Koski 2003-06-22 21:21:34 UTC
As far as I can tell, no.  The .desktop file simply has "Exec=konsole". 
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-06-23 01:36:18 UTC
The issue is basically:

  KDM/whatever do source /etc/profile during startup to get PATH and some
  other stuff correct.  As you can see, this is however with TERM=dumb,
  meaning it is a child process (no tty attached) that does this.

  If you now launch a terminal in X, and you do not tell it to be a login
  shell, it *should* not source /etc/profile (note, this is a *nix design
  feature) - same as running su, and not 'su -'.

To 'fix' it, you need to tell Konsole to behave as a login shell.  Last
time I checked, you need to add '-l' to the exec line in its .desktop.
I do not know if it supports it as a option like gnome-terminal or
multi-gnome-terminal.
Comment 4 Ryan Koski 2003-06-23 21:28:31 UTC
Hmmm... well, OK.  I filed this as a baselayout bug because the behavior changed as a result 
of upgrading baselayout.  I suppose this needs to be assigned to the KDE package maintainer 
so that the default menu/shortcut entries for konsole include the login shell option (which is 
--ls). 
Comment 5 Caleb Tennis (RETIRED) gentoo-dev 2003-07-07 10:22:14 UTC
*** Bug 23554 has been marked as a duplicate of this bug. ***
Comment 6 Alwyn Schoeman 2003-07-18 07:35:06 UTC
I do not see making it a login shell as the solution, it is supposed to be an interactive shell. 
 
The solution must be in fixing ~/.bashrc.  
 
/etc/skel/.bashrc sets the PROMP_COMMAND to something similar as PS1 in /etc/profile.  
Apart from the fact that it doesn't seem to work as advertised in the manpage, it doesn't make 
sense. Why not just do an export PS1=whatever in ~/.bashrc and /etc/skel/.bashrc? 
Comment 7 Alwyn Schoeman 2003-07-18 07:44:50 UTC
Sorry didn't realize the PROMPT_COMMAND in .bashrc is used to set title of console... 
Comment 8 SpanKY gentoo-dev 2003-08-22 11:39:20 UTC

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