Bug 19205
Summary: | The "-title" parameter for xterm and gnome-terminal doesn't work | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | danmcnaul |
Component: | setup | Assignee: | Bill Nottingham <notting> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7.0 | CC: | danmcnaul, rvokal |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-05-21 19:09:09 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
danmcnaul
2000-10-16 21:09:05 UTC
The default prompt sets the titlebar too. Set the PROMPT_COMMAND environment variable differently There is no PROMPT_COMMAND environment variable set on my system to conflict with the -title parameter. This IS a bug. The -title should set the title bar as stated in the man pages. As it did in past releases. McNaul I agree with Dan. I have scripts that put specific titles on specific xterms running specific programs which I use in my work. Now they are all overidden with the 'user@hostname pwd' and I cannot distinguish them at a glance on the KDE taskbar, because now they all show the same user name and part of the hostname. It is all very well to add a new option and environment variable, but the DEFAULT BEHAVIOR when the variable is not set (which it isn't) SHOULD NOT CHANGE. I do not know where to find documentation on this variable or how to set it to get the old behavior back, and I SHOULDN'T HAVE TO. Meanwhile, my work patterns are disrupted and my productivity is decreased.... Oh, I notice that this bug is for RH7.0. Actually the problem began in RH6.2. Also, please excuse my caps - I don't mean to shout - it's just easier than italics or bold ;-) I just reproduced this and it *is* extremely annoying, I agree. I tracked the problem down to /etc/bashrc, it contains code: if [ "$PS1" ]; then if [ -x /usr/bin/tput ]; then if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal stty erase `tput kbs` fi fi case $TERM in xterm*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' ;; *) ;; esac This is totally broken, and should not be forced upon a user. This code needs to be removed, moved to the skeleton files so a user can disable it if they want, or implemented in another way. I recommend doing away with it myself, but that decision is ultimately up to the bash package maintainer. Changing packages.. Bero, can you look into this and see if there is an obvious way to fix it? For now the obvious workaround is editing ~/.bashrc and stopping it from sourcing /etc/bashrc I'm not sure how you'd go about detecting wether or not xterm has been given a title argument. If it cannot be fixed easily, the best way is likely to change the default behaviour of xterm to display user@host:[$|#]<cwd> Let me know if you think this is best, and I'll hack on xterm. I just looked into the xterm source and while I could hack this into xterm for the default window title, once it is set, it will stay like that so it isn't very useful because the path does not bet updated when you cd. So.. I think the code should be moved to the .bashrc skeleton files instead of /etc/bashrc, and logic put in to determine if xterm is being called with the title arg. I'm going to go hack for a bit. I played around with it a bit and here is some crud I came up with. As is, it does not quite work, but is close, however it would only work with xterm, and other similar apps that take -title, -T as args to set the title. # Was xterm given the -title or -T args? cat /proc/$PPID/cmdline |grep "\-\(title\|T\)" >& /dev/null [ $? ] || { PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' } It might be possible to tweak it into working, but it is nothing more than a hack. bashrc lives in setup these days... The current version has some hooks you might be interested in, though: If you create /etc/sysconfig/bash-prompt-xterm and /etc/sysconfig/bash-prompt-default they will override the default PROMPT_COMMAND. Also, you can override it in your ~/.bashrc. |