Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18456 - Small change to /etc/profile to make xterm titlebars update properly
Summary: Small change to /etc/profile to make xterm titlebars update properly
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-29 20:02 UTC by Patrick McLean
Modified: 2003-03-31 16:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Here's the patch as a file (didn't see attachment on the new bug page) (profile.patch,938 bytes, text/plain)
2003-03-29 20:03 UTC, Patrick McLean
Details
Here's the patch as a file (didn't see attachment on the new bug page) (profile.patch,938 bytes, patch)
2003-03-29 20:04 UTC, Patrick McLean
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McLean gentoo-dev 2003-03-29 20:02:49 UTC
I noticed that the xterm titlebars don't update their information on gentoo, so
I managed to make a small patch to make them update it properly (info from the
bash prompt HOWTO)
Here's a patch:

--- oldprofile  2003-03-29 20:01:38.000000000 -0500
+++ profile     2003-03-29 20:01:56.000000000 -0500
@@ -13,13 +13,21 @@
 then
        if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
        then
-               export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
+               if [ "$TERM" = "xterm" ]; then
+                       export PS1='\[\033]0;\u@\h:\w\007\]\[\033[01;31m\]\h
\[\033[01;34m\]\W \$ \[\033[00m\]'
+               else
+                       export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$
\[\033[00m\]'
+               fi
        fi
        export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
 else
        if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
        then
-               export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
+               if [ "$TERM" = "xterm" ]; then
+                       export PS1='\[\033]0;\u@\h:\w\007\]\[\033[01;32m\]\u@\h
\[\033[01;34m\]\W \$ \[\033[00m\]'
+               else
+                       export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$
\[\033[00m\]'
+               fi
        fi
        export PATH="/bin:/usr/bin:${PATH}"
 fi
Comment 1 Patrick McLean gentoo-dev 2003-03-29 20:03:56 UTC
Created attachment 10003 [details]
Here's the patch as a file (didn't see attachment on the new bug page)
Comment 2 Patrick McLean gentoo-dev 2003-03-29 20:04:26 UTC
Created attachment 10004 [details, diff]
Here's the patch as a file (didn't see attachment on the new bug page)
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-31 16:26:58 UTC
Have a look at /etc/skel/.bashrc ...