Created
October 8, 2012 20:11
-
-
Save earthmeLon/3854658 to your computer and use it in GitHub Desktop.
.bashrc - Set terminal title
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add this to ~/.bashrc | |
#Set current terminal's title | |
function settitle() | |
{ | |
if [ $# -eq 0 ] | |
then | |
eval set -- "\\u@\\h: \\w" | |
fi | |
case $TERM in | |
xterm*) local title="\[\033]0;$@\007\]";; | |
*) local title='' | |
esac | |
local prompt=$(echo "$PS1" | sed -e 's/\\\[\\033\]0;.*\\007\\\]//') | |
PS1="${title}${prompt}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment