Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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?
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
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.
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207
Thanked: 0
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
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.
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?
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.