From: no.top.post on
I want to replace the useless "root(a)localhost" in my $PS1 by <consoleNumber>
How do users know which VT they are in, as they step from one to the
other, without remembering 'which button they pressed last time' ?!

In article <pan.2009.10.02.15.40.38(a)yoyo.ORG>, J G Miller <miller(a)yoyo.ORG> wrote:

> On Fri, 02 Oct 2009 13:57:15 +0000, no.top.post wrote:
> > Can anybody tell how to set PS1 to show the VT number [I tried
> > /etc/profile] and failed ?
>
> If using bash, then you need to set PS1 in bashrc, not /etc/profile
> which is only sourced for login shells.
>
OK, File: bashrc ==
# are we an interactive shell?
if [ "$PS1" ]; then
case $TERM in
xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
-----
And my prompt & the 3 evn-VARS are shown by:---
[root(a)localhost lsofTut]# echo $USER
eas <--- I su-ed to "root"
[root(a)localhost lsofTut]# echo $HOSTNAME
localhost.localdomain
[root(a)localhost lsofTut]# echo $PWD
/mnt/cdrom/Debug/lsofTut
-------------
But I dont know if/what to use to replace "HOSTNAME" to have PS1
show the VTnumber.
So, I'm seeing if/what env-VAR might show the VTnumber:-
# /usr/bin/printenv | grep onsol ==
KONSOLE_DCOP=DCOPRef(konsole-1279,konsole)
KONSOLE_DCOP_SESSION=DCOPRef(konsole-1279,session-3)

Where the "3" is the VT3 [of Desktop4]
So if my PS! replaced "root(a)localhost" with <3> that would be good.
--------------

> > Q. is chroot a memory-hog with kernel 2.6* , or is there some thing
> > wrong with
> > my Debian-lenny installation ?
>
> You could always try doing an exec chroot to ensure that the chroot
> shell replaces the first shell and so that you do not have a shell
> within a shell running.
>
Thanks, how would I do that ?

== TIA.