Skip to content
Tom Feist edited this page Jan 16, 2011 · 13 revisions

Irssi Text UI Overview

Irssi is deliberately designed to allow most of the actual text and formatting to be customised by themes and scripts. This is achieved by a combination of expandable markup templates, and special escape codes to generate colour and other formatting features.

  • Internals documents the underlying mechanism for how these features are implemented, but this page in intended to give an overview for people looking to write or customise their theme files.

  • Irssi::UI::Theme also contains details of the functions available to script writers who wish to use themes and formats within their code.

  • Formats describes the various markup syntax used within the theme templates for colour and other formatting.

  • Complete Format List categorises the available internal formats and themes in a way that can be easily searched for those trying to customise a specific aspect.

Templates

Templates are the main workhorse of Irssi the display customisations. In use, they take the form '{template_name arg1 arg2 ...}, or are used in the [[printformat $msg_level, $format, @params`|Irssi#Printing]]

In construction, they are typically written as

# bold the first argument, followed by a space and then all subsequent args.
some_format = "%_$0%_ $1-";

Named arguments are not possible, they exand only based on positional arguments, so it is often necessary to read the code or comments surrounding them to determine the positional value of each argument.

They are subject to various rules of expansion before display, as will be outlined below.

Replaces

Replaces are a special case of "not-quite-templates", but rather global mappings which are applied to rendered templace once everything else is complete.

By default, their only function is to darken the [] brace characters, as shown by the line in Format List#Replacements.

Abstracts

Abstracts are the major contents of each theme file, and define the basic templates which are built upon by formats.

Formats

Formats are special flavours of templaates, in that they are exposed to the use via the /FORMAT <module> <key> <value> command.

Clone this wiki locally