# display attributes

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), 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 only for finding macros without attributes, e.g. "`/list -an`".

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 specify black, red, green, yellow, blue, magenta, cyan, white, 8 thru 15, bgblack, bgred, bggreen, bgyellow, bgblue, bgmagenta, bgcyan, or bgwhite. 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. See: color.

The "h" (hilite) attribute is special. If specified, the attributes listed in the %{hiliteattr} variable will be combined with the other attributes listed. For example, the commands

          /set hiliteattr=r
          /echo -ahu foobar

will 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.

Back to index
Back to tf home page

Copyright © 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004 Ken Keys