Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Konsole prompts / how to change?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
ibnBatuta
n00b
n00b


Joined: 27 Feb 2004
Posts: 27
Location: London UK

PostPosted: Mon Mar 01, 2004 10:42 pm    Post subject: Konsole prompts / how to change? Reply with quote

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
View user's profile Send private message
bmichaelsen
Veteran
Veteran


Joined: 17 Nov 2002
Posts: 1277
Location: Hamburg, Germany

PostPosted: Mon Mar 01, 2004 10:59 pm    Post subject: Reply with quote

Just follow the link on this page:
http://michaelsen.kicks-ass.net/moinmoin/moin.cgi/app_2dshells_2fbash
to get a tutorial from the mighty drobbins himself :wink:
Back to top
View user's profile Send private message
ibnBatuta
n00b
n00b


Joined: 27 Feb 2004
Posts: 27
Location: London UK

PostPosted: Tue Mar 02, 2004 2:14 am    Post subject: Reply with quote

Thanks , will have a read tomorrow :D
Back to top
View user's profile Send private message
pivertd
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 185
Location: Arlon, Belgium

PostPosted: Tue Mar 02, 2004 6:57 pm    Post subject: Konsole prompts / how to change? Reply with quote

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
View user's profile Send private message
pivertd
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 185
Location: Arlon, Belgium

PostPosted: Tue Mar 02, 2004 7:09 pm    Post subject: Konsole prompts / how to change? Reply with quote

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
View user's profile Send private message
miklosvh
n00b
n00b


Joined: 10 Feb 2004
Posts: 2
Location: Atlanta

PostPosted: Wed Mar 03, 2004 7:17 pm    Post subject: Reply with quote

Thanks that worked. Was that just missing from our default .bashrc or how is it supposed to work ? Just curious.
Back to top
View user's profile Send private message
bmichaelsen
Veteran
Veteran


Joined: 17 Nov 2002
Posts: 1277
Location: Hamburg, Germany

PostPosted: Wed Mar 03, 2004 9:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
ibnBatuta
n00b
n00b


Joined: 27 Feb 2004
Posts: 27
Location: London UK

PostPosted: Thu Mar 04, 2004 5:17 am    Post subject: Re: Konsole prompts / When Xlogin as root ? Reply with quote

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
View user's profile Send private message
CheshireCat
Guru
Guru


Joined: 25 Aug 2002
Posts: 572

PostPosted: Thu Mar 04, 2004 5:33 am    Post subject: Reply with quote

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:
Code:
Exec=

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum