Mailing List Archive

shell prompt highlightning
Hi, list

I've got question about shell prompt highlightning in xterm
Firstly, when I've just installed my Gentoo and it boot to 3 runlevel
prompt was green for any user log on, and red for root
also it looked like user@machinename $ - so it was easily to determine
who works now (w/o whoami)

now I've made changes to boot into X (KDE) (`rc-update -a xdm default`,
add `DISPLAYMANAGER="kdm"` to /etc/rc.conf and changed in /etc/inittab
`id:3:initdefault:` to `id:5:initdefault:`)

I've got what I wanted but now in xterm bash prompt looks like w/b
`bash-2.05b$`
and return to what I want to have only after `su - user`

so what I should correct to have colorized prompt in my console

Thanks



--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
That's exactly what I did, I appended the following to /etc/bashrc , as
far as every user should use it:

if [ -f /etc/profile ]; then
. /etc/profile
fi

Francisco


Ovidiu Bivolaru wrote:

> Hi,
>
> You could achieve this by setting in your $HOME/.bashrc
> source /etc/profile
>
> Regards,
> Ovidiu
>
> bit wrote:
>
>> Hi, list
>>
>> I've got question about shell prompt highlightning in xterm
>> Firstly, when I've just installed my Gentoo and it boot to 3 runlevel
>> prompt was green for any user log on, and red for root
>> also it looked like user@machinename $ - so it was easily to
>> determine who works now (w/o whoami)
>>
>> now I've made changes to boot into X (KDE) (`rc-update -a xdm
>> default`, add `DISPLAYMANAGER="kdm"` to /etc/rc.conf and changed in
>> /etc/inittab `id:3:initdefault:` to `id:5:initdefault:`)
>>
>> I've got what I wanted but now in xterm bash prompt looks like w/b
>> `bash-2.05b$`
>> and return to what I want to have only after `su - user`
>>
>> so what I should correct to have colorized prompt in my console
>>
>> Thanks
>


--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
Hi,

You could achieve this by setting in your $HOME/.bashrc
source /etc/profile

Regards,
Ovidiu

bit wrote:

> Hi, list
>
> I've got question about shell prompt highlightning in xterm
> Firstly, when I've just installed my Gentoo and it boot to 3 runlevel
> prompt was green for any user log on, and red for root
> also it looked like user@machinename $ - so it was easily to determine
> who works now (w/o whoami)
>
> now I've made changes to boot into X (KDE) (`rc-update -a xdm
> default`, add `DISPLAYMANAGER="kdm"` to /etc/rc.conf and changed in
> /etc/inittab `id:3:initdefault:` to `id:5:initdefault:`)
>
> I've got what I wanted but now in xterm bash prompt looks like w/b
> `bash-2.05b$`
> and return to what I want to have only after `su - user`
>
> so what I should correct to have colorized prompt in my console
>
> Thanks
>
>
>
> --
> gentoo-user@gentoo.org mailing list
>


--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
bit wrote, On 05.10.2004 02:03:
> Hi, list

> I've got what I wanted but now in xterm bash prompt looks like w/b
> `bash-2.05b$`
> and return to what I want to have only after `su - user`
>
> so what I should correct to have colorized prompt in my console
>
> Thanks

You should open you (X|A|E)Term with the Option -ls
This also works with KDE Konsole.

An other possibility to achieve this put this in ~/.Xdefaults:

*loginShell: true

bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Re: shell prompt highlightning [ In reply to ]
Thilo Six wrote:

>
> You should open you (X|A|E)Term with the Option -ls
> This also works with KDE Konsole.
>
> An other possibility to achieve this put this in ~/.Xdefaults:
>
> *loginShell: true
>
> bye Thilo


Thanks a lot !

--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
On Mon, 4 Oct 2004, Francisco J. A. Ares wrote:

>
> That's exactly what I did, I appended the following to /etc/bashrc , as
> far as every user should use it:
>
> if [ -f /etc/profile ]; then
> . /etc/profile
> fi
>
> Francisco
>
>
> Ovidiu Bivolaru wrote:
>
> > Hi,
> >
> > You could achieve this by setting in your $HOME/.bashrc
> > source /etc/profile
> >
> > Regards,
> > Ovidiu
> >
> > bit wrote:
> >
> >> Hi, list
> >>
> >> I've got question about shell prompt highlightning in xterm
> >> Firstly, when I've just installed my Gentoo and it boot to 3 runlevel
> >> prompt was green for any user log on, and red for root
> >> also it looked like user@machinename $ - so it was easily to
> >> determine who works now (w/o whoami)
> >>
> >> now I've made changes to boot into X (KDE) (`rc-update -a xdm
> >> default`, add `DISPLAYMANAGER="kdm"` to /etc/rc.conf and changed in
> >> /etc/inittab `id:3:initdefault:` to `id:5:initdefault:`)
> >>
> >> I've got what I wanted but now in xterm bash prompt looks like w/b
> >> `bash-2.05b$`
> >> and return to what I want to have only after `su - user`
> >>
> >> so what I should correct to have colorized prompt in my console
> >>
> >> Thanks
> >
>

Hi,

A quote from the bash man page:
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.

So /etc/bashrc won't be invoked.

HTH.
Cheers,
Tamas Sarga
--
A day is 24 hours long. Egy nap 24 órából áll.
A box of beer contains 24 bottles. Egy tálcán 24 üveg sör van.
I don't believe in coincidence. Nem hiszek a véletlenekben.

--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
On Tuesday 05 October 2004 08:48 am, Tamas Sarga wrote:
> On Mon, 4 Oct 2004, Francisco J. A. Ares wrote:
> > That's exactly what I did, I appended the following to /etc/bashrc ,
> > as far as every user should use it:
> >
> > if [ -f /etc/profile ]; then
> > . /etc/profile
> > fi
> >
> > Francisco
> >
snip
>
> Hi,
>
> A quote from the bash man page:
> 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.
>
> So /etc/bashrc won't be invoked.
>
> HTH.
> Cheers,
> Tamas Sarga
> --

Adding the following lines to my ~/.bashrc file makes my prompt come out
as expected.

# Source global definitions
if [ -f /etc/profile ]; then
. /etc/profile
fi

Your quote above says that ~.bashrc WILL be executed, since we are in an
"interactive shell that is not a login shell". It was being executed
because the PROMPT_COMMAND defined in it WAS putting text in the window
title of the konsole. It just needed to include the definitions
from /etc/profile to get the shell prompt correct.

Paul



--
gentoo-user@gentoo.org mailing list
Re: shell prompt highlightning [ In reply to ]
On Tue, 5 Oct 2004, Paul Misner wrote:

>
> On Tuesday 05 October 2004 08:48 am, Tamas Sarga wrote:
> > On Mon, 4 Oct 2004, Francisco J. A. Ares wrote:
> > > That's exactly what I did, I appended the following to /etc/bashrc ,
> > > as far as every user should use it:
> > >
> > > if [ -f /etc/profile ]; then
> > > . /etc/profile
> > > fi
> > >
> > > Francisco
> > >
> snip
> >
> > Hi,
> >
> > A quote from the bash man page:
> > 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.
> >
> > So /etc/bashrc won't be invoked.
> >
> > HTH.
> > Cheers,
> > Tamas Sarga
> > --
>
> Adding the following lines to my ~/.bashrc file makes my prompt come out
> as expected.
>
> # Source global definitions
> if [ -f /etc/profile ]; then
> . /etc/profile
> fi
>
> Your quote above says that ~.bashrc WILL be executed, since we are in an
> "interactive shell that is not a login shell". It was being executed
> because the PROMPT_COMMAND defined in it WAS putting text in the window
> title of the konsole. It just needed to include the definitions
> from /etc/profile to get the shell prompt correct.
>
> Paul
>

Hi,

If you add it to ~/.bashrc, then it will be good, if you add to
/etc/bashrc then won't.
I used another solution, 'cause the default prompt wasn't good enough
for me. I added an
export PS1="blalblalbla"
to my ~/.bashrc, and execute ~/.bashrc from my ~/.bash_profile.

Cheers,
Tamas Sarga
--
A day is 24 hours long. Egy nap 24 órából áll.
A box of beer contains 24 bottles. Egy tálcán 24 üveg sör van.
I don't believe in coincidence. Nem hiszek a véletlenekben.

--
gentoo-user@gentoo.org mailing list