by makecheck · 14y ago · 0 comments
The "0;" means "set both icon and window title"; you can also make this "1;" to set the icon title only (i.e. when minimized) and "2;" to set the window title only (i.e. when not minimized). For example:
printf "\033]1;icon title\033\\"
printf "\033]2;window title\033\\"
If your terminal supports this, you'll see "icon title" when the window is minimized (e.g. in the Dock on Mac OS X) and "window title" otherwise.If you want to do this in any Bourne-compatible shell and not just "bash", try omitting the "function" word. And if your system does not have an "echo" that supports these options, see if the "printf" command is available and use that instead. For example:
settitle() {
printf "\033]0;$1\033\\"
}
There are other tricks, e.g. I use "zsh" and in my ".zshrc" this causes the window title to show the hostname and current directory path any time "cd" is used: chpwd () {
printf "\033]0;[${HOST}] ${PWD}\033\\"
}No comments yet.