Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fltk/fltk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheFl_Terminal widget is an output-only text widget supporting ASCII and UTF-8/Unicode with VT100/xterm style escape sequences, text colors and attributes, scrollback history, and mouse selection.
Constructor
Text Output
Screen Control
Clears the entire display and history.
Clears the screen (ESC [ 2 J).
Whether to scroll current screen to history
Clears screen and homes cursor (ESC [ H ESC [ 2 J).
Whether to scroll current screen to history
Clears the scrollback history (ESC [ 3 J).
Resets the terminal to initial state (ESC c).
Homes the cursor to position 0,0 (ESC [ H).
Cursor Control
Returns the current cursor row (0-based).
Returns the current cursor column (0-based).
Colors
Sets the default text foreground color.
Color value (0xRRGGBB00 format)
Sets the default text background color.
Color value (0xffffffff for transparent)
Sets the default foreground color used by ESC[0m reset.
Color value
Sets the default background color used by ESC[0m reset.
Color value
Display Settings
Sets the number of scrollback history lines.
Number of history lines
Enables or disables ANSI escape sequence parsing.
true to enable, false to disable
Margins
Redraw Control
Sets when the terminal redraws.
- NO_REDRAW - App must call redraw()
- RATE_LIMITED - Timer controlled (default)
- PER_WRITE - After every append()/printf()
Selection
Returns the currently selected text.Returns pointer to selected text, or NULL if no selection.
Returns the length of the selected text.
Text Attributes
The following text attributes can be set via ANSI escape codes:- Bold -
\033[1m- Brighter/thicker text - Dim -
\033[2m- Lower brightness - Italic -
\033[3m- Italicized text - Underline -
\033[4m- Underlined text - Inverse -
\033[7m- Swap foreground/background - Strikeout -
\033[9m- Line through text - Normal -
\033[0m- Reset to normal
Color Codes
3-bit Colors (8 colors)
24-bit RGB Colors
Example
Advanced Example with Timer
See Also
- Fl_Text_Display - Multi-line text display widget
- Fl_Text_Editor - Text editor with input support