Home Contents | # gcx:terminal | Graphics | Core4 Lua Commands

## SYNOPSIS

trm = gcx:terminal([font])

## DESCRIPTION

Creates a new terminal emulator instance that works on the graphics context gcx. The emulator claims VT102 compatibility, with additional support for color attributes.

When no font is given, the terminal emulator uses the font that is configured within gcx. For best results, this must be a fixed-width font.

The new terminal emulator will not initially update the view. You must call trm:redraw() once after creating a new terminal.

Output is written to the terminal using trm:write().

There is an internal buffer that keeps a copy of the emulated text screen. Only changed data is painted onto the graphics bitmap, in order to get best performance.

## RETURN VALUE

A handle for the terminal emulator.

## ERRORS

Raises an error if gcx is not a graphics context.

## EXAMPLE

> > > >
fb = gfx.open() trm = fb:terminal() trm:redraw() trm:write("\x1B[32mHello \x1B[36mWorld\x1B[0m")

## SEE ALSO

trm:close, trm:update, trm:redraw, trm:write, trm:colors