LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-27-2003, 02:08 AM   #1
King V
Member
 
Registered: Oct 2001
Location: New Jersey
Distribution: Mandrake 10.2
Posts: 75

Rep: Reputation: 15
Question xterm and titlebar


All,

Ok, I'm using Mandrake 9.0 . . and have taken care of that xterm vs xterm.real issue that would prevent my .Xdefaults settings for xterm from working properly.

Anyway, most other systems I'd worked with, the titlebar for the Xterm program simply said "xterm" up top.

When I start an Xterm however, I note that the titlebar shows that for only the briefest split second, then instead it shows a string that is in the form

username@full-domain-name: current-directory

and it will change dynamically when I change directories.

The thing is that the properties of that window don't show xterm being in the window class or title at all.

CORRECTION: that last statement about the properties of the window isn't true . . it does show Class as being Xterm and resource as being xterm . . my mistake.

Thus in my .fvwm2rc file, the Style settings I have for xterm aren't recognized.

So how do I prevent the xterm title from showing that whole thing? Or, at the very least, can I start it with the word "xterm" then let the whole other string be displayed afterward?

I'm not sure what in the system sets the behavior to be as it currently is. It seems to be that way by default.

Last edited by King V; 03-27-2003 at 07:16 PM.
 
Old 03-27-2003, 10:32 AM   #2
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
I'm assuming that you are launching Xterm from a menu... have you checked to see how the WM is invoking the xterm? What happens if you launch xterm from the command prompt yourself?
 
Old 03-27-2003, 12:29 PM   #3
King V
Member
 
Registered: Oct 2001
Location: New Jersey
Distribution: Mandrake 10.2
Posts: 75

Original Poster
Rep: Reputation: 15
Actually, the menu only does an "exec xterm" . . but I usually don't use the menus, I ususally launch it from the command prompt simply by typing xterm then hitting ENTER

Both have the same effect.
 
Old 03-27-2003, 01:42 PM   #4
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
perhaps the title is compiled into the xterm executable (I don't know if thats possible). It could be that the default title can be specified at compile time... in other words, download the xterm source and compile it from source... but b4 you do that I would check the xterm configuration files, but I figured you've pro'lly done that already.
 
Old 03-27-2003, 01:46 PM   #5
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
This behaviour of xterm can be achieved by using special character sequence in your bash PS1 variable. You need to remove that sequence from the script that sets that variable. I added this feature to my xterms on purpose. I made a script and put it into /etc/profile.d/shell.sh. Here it is:

if [ "$TERM" = "linux" ]
then


if
[ "$UID" = "0" ];
then
# I am root
GREEN="\[\e[0;33m\]"
CYAN="\[\e[0;31m\]"
fi
PS1="$YELLOW|:-$GREEN($CYAN\u$GREEN@$CYAN\h$GREEN:\w>$GREEN$CYAN\$$NONE "


else


if
[ "$UID" = "0" ];
then
# I am root
GREEN="\[\e[0;33m\]"
CYAN="\[\e[0;31m\]"
fi
PS1="\[\e]2;\w\a\]$YELLOW|:-$GREEN($CYAN\u$GREEN@$CYAN\h$GREEN:\w>$GREEN$CYAN\
$$NONE "
fi

The sequence i'm talking about should be \[\e]2;\w\a\], for more info read the bash prompt how to.
Of course, in your case it might be due to something else, did you try exporting the PS1 variable to something like > and then starting a new xterm?
-NSKL
 
Old 03-27-2003, 07:08 PM   #6
King V
Member
 
Registered: Oct 2001
Location: New Jersey
Distribution: Mandrake 10.2
Posts: 75

Original Poster
Rep: Reputation: 15
jpbarto,
Actually, I have NOT checked the xterm configuration files..... which files are they and where are they usually kept?

NSKL,
I checked. My PS1 variable is an oddball string which makes the prompt somewhat similar, but doesn't seem to have those particular characters that cause the xterm titlebar to change.

Actually, double-checked, and the word xterm definitely shows up in the titlebar for a brief moment when I start up an xterm.

Xterm titlebar format is:
user@fully-qualified-domain-name: full-pathname-of-current-directory

whereas the prompt is:
user@hostname current-directory-name

Thus if I was in /root/tmp/mystuff the former would show the whole thing, the latter would show simply mystuff

Anyway, I hope I don't have to get another version of, or recompile, the xterm. It's not too much trouble or anything, but it's just an annoyance.
 
Old 03-27-2003, 08:57 PM   #7
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
have you ever tried using the command:
xterm -title string
 
Old 03-27-2003, 09:09 PM   #8
King V
Member
 
Registered: Oct 2001
Location: New Jersey
Distribution: Mandrake 10.2
Posts: 75

Original Poster
Rep: Reputation: 15
Just tried it . . . . the "string" shows up for that brief moment the way "xterm" does if I type that without the arguments, then quickly gets replaced by the username@fully-qualified-domain: current-full-directory-path

So something is overriding it AFTER the invocation of the xterm I guess. But what? And how?
 
Old 03-28-2003, 10:29 AM   #9
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
There should be two configuration files in (according to xterms man page) /usr/lib/X11/app-defaults called XTerm and XTerm-color. Briefly looking through the XTerm file on my pc it doesn't look like there's anything specifying title, but it might be worth looking at. Also some distros can be a little odd.. for example when you install Slackware vi is a symlink to some editor named Elvis... (in other words not really vi or vim). Check your xterm and make sure that what you're executing is not a symbolic link. (Just throwin out ideas now).
 
Old 03-28-2003, 11:46 AM   #10
bahamat
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 158

Rep: Reputation: 30
The xterm title can be set with an ENV variable.

You have something like this in your.bashrc:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

You can make it echo whatever you want. This overrides the -title switch.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xterm - howto lauch an xterm into a specific directory jobano Linux - Software 8 02-26-2008 04:18 PM
KDE titlebar height Seiken Linux - Software 4 03-09-2005 03:16 PM
how is black xterm background in IceWM when issue a xterm command? BRAHmS Linux - Software 1 02-14-2005 04:51 AM
Small titlebar fonts harleyv2 Linux - Newbie 0 02-17-2004 05:29 PM
file progress in xterm titlebar with bash brian0918 Linux - Newbie 3 06-11-2003 07:04 PM


All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration