View previous topic :: View next topic |
Author |
Message |
ibnBatuta n00b
Joined: 27 Feb 2004 Posts: 27 Location: London UK
|
Posted: Mon Mar 01, 2004 10:42 pm Post subject: Konsole prompts / how to change? |
|
|
Hi ,
If i don't have xdm running & then 'startx' , opening a konsole in kde gives me the normal prompt of 'hostname directory'. However , if xdm is running opening a konsole gives "bash-2.05b$" as a prompt.
How can I change this behaviour & get back the 'host directory' prompt?
TIA
nb 2.6.2-r1 dev , kde 3.2 |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
|
Back to top |
|
|
ibnBatuta n00b
Joined: 27 Feb 2004 Posts: 27 Location: London UK
|
Posted: Tue Mar 02, 2004 2:14 am Post subject: |
|
|
Thanks , will have a read tomorrow |
|
Back to top |
|
|
pivertd Apprentice
Joined: 08 Feb 2004 Posts: 185 Location: Arlon, Belgium
|
Posted: Tue Mar 02, 2004 6:57 pm Post subject: Konsole prompts / how to change? |
|
|
Hi !!!
Thanks for the answer... but I don't think it's the right one. Personally, I know how to configure the PS1 variable...
But the question is WHY konsole does not read the same /etc/profile as when you login directly on the console ?
I've seen this problem multiple times on Gentoo KDE 3.1.x and 3.2
And what should we do to solve this problem.
Thanks !! |
|
Back to top |
|
|
pivertd Apprentice
Joined: 08 Feb 2004 Posts: 185 Location: Arlon, Belgium
|
Posted: Tue Mar 02, 2004 7:09 pm Post subject: Konsole prompts / how to change? |
|
|
Hi, just replying to myself
It seems that konsole does not read ~/.bash_profile AND /etc/profile.
However, konsole read the ~/.bashrc
So, as solution, I added the
[ -f /etc/profile ] && . /etc/profile
line at the end of my ~/.bashrc file.
BTW, you can uncomment the
[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
line to have a more "smart" bash completion. (ie, propose only directory and not files after a "cd " command.)
Hope it helps...
Bye !! |
|
Back to top |
|
|
miklosvh n00b
Joined: 10 Feb 2004 Posts: 2 Location: Atlanta
|
Posted: Wed Mar 03, 2004 7:17 pm Post subject: |
|
|
Thanks that worked. Was that just missing from our default .bashrc or how is it supposed to work ? Just curious. |
|
Back to top |
|
|
bmichaelsen Veteran
Joined: 17 Nov 2002 Posts: 1277 Location: Hamburg, Germany
|
Posted: Wed Mar 03, 2004 9:06 pm Post subject: |
|
|
from the bash manpage.
Code: | /etc/profile
The systemwide initialization file, executed for login shells
~/.bash_profile
The personal initialization file, executed for login shells
~/.bashrc
The individual per-interactive-shell startup file |
Quote: | However , if xdm is running opening a konsole gives "bash-2.05b$" as a prompt. |
This is a login shell.
Code: | When an interactive shell that is not a login shell is started,
bash reads and executes commands from ~/.bashrc, if that file exists.
This may be inhibited by using the --norc option. The --rcfile file
option will force bash to read and execute commands from file
instead of ~/.bashrc.
|
No reading of /etc/profile. |
|
Back to top |
|
|
ibnBatuta n00b
Joined: 27 Feb 2004 Posts: 27 Location: London UK
|
Posted: Thu Mar 04, 2004 5:17 am Post subject: Re: Konsole prompts / When Xlogin as root ? |
|
|
Hi ,
Yes this method works great when I Xlogin with a standard userid, but if Xlogin as root then there is no ~/.bashrc file at all? |
|
Back to top |
|
|
CheshireCat Guru
Joined: 25 Aug 2002 Posts: 572
|
Posted: Thu Mar 04, 2004 5:33 am Post subject: |
|
|
Konsole does not create a login shell by default, which is why your .bash_profile is not loaded. If you look in the shell.desktop file (should be in $KDEDIR/share/apps/konsole), it contains the following:
I'm assuming that not specifying the program to execute is some sort of magic signal to konsole to execute the user's specified shell. What I've done on my system is to replace that line with this:
Code: | Exec=/bin/sh -c 'exec ${SHELL} -l' |
Konsole will now start the user's selected shell with the -l argument, which specifies a login shell for most shells (I checked for bash, zsh, csh, and tcsh, although nobody on my system uses anything but bash). |
|
Back to top |
|
|
|