This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
title_examples [2005-01-05 16:28] 209.251.43.194 |
title_examples [2016-11-11 12:49] 131.188.78.95 added tcsh example for non-Linux systems |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Titles (naming windows) | + | ====== Title Examples ====== |
- | Each screen window has a title. | + | Each screen window has a title. |
- | You can set the default title for your windows with the '' | + | You can set the default title for your windows with the '' |
- | ==== Simple examples ==== | + | ===== Simple examples |
In .screenrc, set the default title of all windows to " | In .screenrc, set the default title of all windows to " | ||
Line 38: | Line 38: | ||
- | ==== Setting the title to the name of the running program ==== | + | ===== Setting the title to the host you ssh'd into ===== |
+ | |||
+ | A nice solution may be found at http:// | ||
+ | |||
+ | See also http:// | ||
+ | |||
+ | |||
+ | ===== Setting the title to the name of the running program | ||
A common desire is to name one's windows after the programs running in them. A window sitting at a shell prompt might be named " | A common desire is to name one's windows after the programs running in them. A window sitting at a shell prompt might be named " | ||
Line 46: | Line 53: | ||
< | < | ||
alias postcmd 'echo -ne " | alias postcmd 'echo -ne " | ||
+ | </ | ||
+ | |||
+ | On non-Linux systems like (Free)BSD or Solaris you may use the POSIX version with printf: | ||
+ | < | ||
+ | alias postcmd ' | ||
</ | </ | ||
Line 52: | Line 64: | ||
< | < | ||
preexec () { | preexec () { | ||
- | echo -ne "\ek${(s: :)1[1]}\e\\" | + | echo -ne " |
} | } | ||
</ | </ | ||
Line 68: | Line 80: | ||
< | < | ||
export PS1=' | export PS1=' | ||
+ | </ | ||
+ | |||
+ | Please note the use of single quotes. Also, if you want to use it with a bash prompt that spans several lines you have to put it on the last line. For example: | ||
+ | |||
+ | < | ||
+ | export PS1=' | ||
+ | export PS1=" | ||
</ | </ | ||
As a special case, if the //< | As a special case, if the //< |