Many TF commands take an argument to specify an
attribute list,
containing one or more of:
"n" (none),
"x" (exclusive),
"g" (gag),
"G" (nohistory),
"L" (nolog),
"A" (noactivity),
"u" (underline),
"r" (reverse),
"B" (bold),
"b" (bell),
"h" (hilite),
"E" (error),
"W" (warning),
or
"Ccolor" (color).
These
attributes are used to display text
associated with the command.
Use commas to separate attributes within an attribute list; commas may be
omitted between single-letter attributes. For example,
"BuCred,Cbgyellow
" means bold underlined red text on a yellow
background.
"None" ("n") is useful for finding macros without attributes (e.g.
"/list -an
") or
for turning off attributes in the middle of a line (e.g.
"/echo -p foo @{u}bar@{n} baz
").
Normally, new attributes are combined with the pre-existing attributes. But if the new attributes include "x" (exclusive), the pre-existing display attributes are turned off first. So, for example, if one trigger with -au and another trigger with -Pr match the same line, the whole line will be underlined and part of it will also be reversed; but if the second trigger had -Pxr instead, then most of the line would be underlined, and part would be reversed but not underlined.
The "G" (nohistory) attribute prevents the line from being recorded in history. The "L" (nolog) attribute prevents the line from being recorded in a log file.
The "A" (noactivity) attribute prevents the line from causing an ACTIVITY hook or a nonzero moresize(). For example, the following command prevents people connecting and disconnecting from counting as activity:
/def -aA -q -t"{*} has {*connected.}" noact_connect
The "Cname" (Color) attribute allows you to name a color. The "C" must be followed by the name of the color; a comma after the name can be used to separate it from attributes that follow it. Depending on your terminal and how tf was compiled, there may be 8, 16, or 256 colors available. See: color.
The "h" (hilite), "E" (error), and "W" (warning) attributes are special. When "h", "E", or "W" is specified, it is replaced with the attributes listed in the %{hiliteattr}, %{error_attr}, or %{warning_attr} variable, respectively. Additionally, error and warning messages generated by tf automatically have the "E" and "W" attributes, so you can alter their appearance by setting the corresponding variable. For example, the commands
/set hiliteattr=r /echo -ahu foobarwill display the word "foobar" with reverse and underline attributes. %{hiliteattr} makes it easy to change the meaning of all your hilite macros at once, without editing each one individually.
The "f" (flash) and "d" (dim) attributes are accepted for backward compatiblity, but ignored.
All attributes except 'n' may be combined usefully. (Even gags can be combined with other attributes: combining 'g' and 'B', for example, will gag the text initially, but will display it as bold if it is recalled with /recall -ag.)
It is possible to apply attributes to a part of a line, using /partial or the -P option of /def. If two or more partial attributes overlap, their effects will be combined (unless the "x" attribute is used). For example, overlapping bold and reverse will appear bold and reverse; overlapping blue and red will appear magenta.
Ansi attribute codes sent by the server will be interpreted by tf if %{emulation} is set to "ansi_attr". See: %emulation.
As of version 5.0, attributes in string values are preserved by just about every string operation, including commands, variables, expression operators, functions, regexp substitutions, $() command substitution, and status bar field expressions. The inline_attr() function can be used to convert attribute codes within a string to actual attributes.
Attributes not supported by your terminal type will be stored, but not displayed.