Contents
How to change the title of an xterm terminal?
A static title may be set for any of the terminals xterm , color-xterm or rxvt, by using the -T and -n switches: Many people find it useful to set the title of a terminal to reflect dynamic information, such as the name of the host the user is logged into, the current working directory, etc. This may be done by using XTerm escape sequences.
Where to find xterm escape sequences in rxvt?
For the full list of xterm escape sequences see the file ctlseq2.txt, which comes with the xterm distribution, or xterm.seq, which comes with the rxvt distribution . These escapes really need to be applied every time the prompt changes.
How to use prompt escapes in the title string?
Unfortunately, there is no equivalent to zsh ‘s print command allowing us to use prompt escapes in the title string, so the best we can do is to use shell variables (in ~/.tcshrc ): switch ($TERM) case “xterm*”: alias precmd ‘echo -n “\\033]0;$ {HOST}:$cwd\\007″‘ breaksw endsw However, this gives the directory’s full path instead of using ~ .
How to set window title based on command?
Let’s take an example. If I run mplayer http://66.197.229.245:8082 in an urxvt window, I would like the title of this window to be set to mplayer http://66.197.229.245:8082 or even better Terminal | mplayer. Or if I run journalctl -b I want the window title to be set to Terminal | journalctl -b or better Terminal | journalctl. Is this possible?
How to dynamically set the urxvt window title?
Closed 7 years ago. I am looking for a way to dynamically set the urxvt window title based on the command input. Let’s take an example. If I run mplayer http://66.197.229.245:8082 in an urxvt window, I would like the title of this window to be set to mplayer http://66.197.229.245:8082 or even better Terminal | mplayer.
How do I set the current command in the title bar in Bash?
Assuming you’re using Bash as your shell you can set this variable. Including the previous command in the title? If you want a more elaborate title bar then you could use this method to dynamically set the currently running command in the title bar.