LeRoy Cressy on 14 Jun 2005 21:07:54 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] New xterm behavior in Debian


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Gran wrote:
> On Tue, Jun 14, 2005 at 02:49:56PM -0400, LeRoy Cressy said:
> 
>>Hi all,
>>
>>With the latest Debian upgrade I noticed that the bash people altered a
>>config file in /etc without prompting about the change.
> 
> 
> dpkg will prompt if both:
> a) you have changed a config file
> b) a new version of the config gile is available
> 
> otherwise it does nothing or promtps.
> 
> 
>>/etc/bash.bashrc has been changed to include the following:
>>
>># If this is an xterm set the title to user@host:dir
>>case "$TERM" in
>>xterm*|rxvt*)
>>   PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
>>   ;;
>>*)
>>   ;;
>>esac
>>
>>This means that if you call xterms with -T string the title string
>>specified in xterm options is overwritten by bash with total disregard
>>to user preferences.
>>
>>I always thought that it was Debian policy to prompt before changing any
>>config file.  Thought this makes upgrading a little slower, the config
>>files are protected.
> 
> 
> PROMPT_COMMAND is not the same as the title string specified with -T.
> PROMPT_COMMAND is what your prompt displays, e.g.
> leroy@debian:~$
> 
> bash.bashrc is sourced _before_ your ~/.bashrc, so any settings in it
> are overridable by your ~/.bashrc.  Are you sure you changed this file,
> or are you assuming it must be this since -T isn't doing what you
> expected?  I would start by looking elsewhere, although if this file did
> get ovrwritten and your changes lost, that would be a serious bug.

When I commented out the /etc/bash.bashrc block containing the the above
mentioned case block, the system returned back to complying to xterm -T
creating a title string.

When I searched the web I saw this block mentioned as setting the title
of an xterm.  I think that it has to deal with \033]0; which might mean
where echo puts the string.

\033 = ESC
]0  Titlebar in the xterm
\007 = BEL

I tried this in a xterm and the titlebar changes appropriately

echo -ne "\033]0;Who Is ${USER}?\007"

Also, PROMPT_COMMAND is just a variable being set with an echo string


> 
> 
> ------------------------------------------------------------------------
> 
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


- --
 Rev. LeRoy D. Cressy  mailto:leroy@lrcressy.com   /\_/\
                       http://lrcressy.com        ( o.o )
                       Phone:  215-535-4037        > ^ <
                       FAX:    215-535-4285

gpg fingerprint:  62DE 6CAB CEE1 B1B3 359A  81D8 3FEF E6DA 8501 AFEA

For info on enigmail:    http://lrcressy.com/linux/mozilla.pdf
For info on gpg:         http://www.gnupg.org/

Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me. (John 14:6)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFCr0blP+/m2oUBr+oRAl1mAJ9MDxJSJ8OAG28agP52gotJedqhngCbBed5
xKULY9dJtdNIkSvdbPeFFXc=
=4dLe
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug