www.delorie.com/gnu/docs/screen/screen_138.html   search  
 
Buy GNU books!


Screen User's Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21. String Escapes

Screen provides an escape mechanism to insert information like the current time into messages or file names. The escape character is % with one exception: inside of a window's hardstatus ^% (^E) is used instead.

Here is the full list of supported escapes:

%
the escape character itself
a
either am or pm
A
either AM or PM
c
current time HH:MM in 24h format
C
current time HH:MM in 12h format
d
day number
D
weekday name
h
hardstatus of the window
l
current load of the system
m
month number
M
month name
n
window number
s
seconds
t
window title
u
all other users on this window
w
all window numbers and names
W
all window numbers and names except the current one
y
last two digits of the year number
Y
full year number
?
the part to the next %? is displayed only if an escape expands to an nonempty string
:
else part of %?
{
attribute/color modifier string terminated by the next }
The c and C escape may be qualified with a 0 to make screen use zero instead of space as fill character. The n escape understands a length qualifier (e.g. %3n).

An attribute/color modifier is is used to change the attributes or the color settings. Its format is `[attribute modifier] [color description]'. The attribute modifier must be prefixed by a change type indicator if it can be confused with a color desciption. The following change types are known:

+
add the specified set to the current attributes
-
remove the set from the current attributes
!
invert the set in the current attributes
=
change the current attributes to the specified set
The attribute set can either be specified as a hexadecimal number or a combination of the following letters:
u
underline
b
bold
r
reverse
s
standout
B
blinking
Colors are coded either as a hexadecimal number or two letters specifying the desired background and foreground color (in that order). The following colors are known:
k
black
r
red
g
green
y
yellow
b
blue
m
magenta
c
cyan
w
white
d
default color
.
leave color unchanged
The capitalized versions of the letter specify bright colors. You can also use the pseudo-color `i' to set just the brightness and leave the color unchanged.

A one digit/letter color description is treated as foreground or background color dependant on the current attributes: if reverse mode is set, the background color is changed instead of the foreground color. If you don't like this, prefix the color with a `.'. If you want the same behaviour for two-letter color descriptions, also prefix them with a `.'.

Examples:

`G'
set color to bright green
`+b r'
use bold red
`= yd'
clear all attributes, write in default color on yellow background.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003