class_="terminal"
Provides an xterm-compatible terminal emulator as a widget.
Description
Explicit Syntax
<dynamic x=""> <widget class_="terminal" value_="@x" scrollback_="[NUMBER]" blink_="0|1" splash_="[TEXT]" connect_="[CONNECTION]"/> </dynamic>
Attributes
value_
- When this variable is changed, its value will be printed to the terminal and then reset to the empty string.
scrollback_
- Specifies the length of the scrollback buffer.
The default is
1000
. blink_
- Specifies whether or not the cursor should blink. Accepts a
0
or1
.When
blink_=0
, the cursor does not blink.When
blink_=1
, the cursor blinks.The default is
1
. splash_
- Defines text that should be printed when the terminal is first rendered, before the
contents (if any) of
value_
are printed. connect_
- Allows the terminal to be connected to an interactive connection handler; this will be
used in the future with WebSocket endpoints, for example, but currently accepts
connect_="jsconsole" to connect the terminal widget to the browser's JavaScript
console.Note: This attribute is mutually exclusive with
value_
.
Example: A simple "Parrot" QuickApp
Outputs whatever text is entered in the console window, using an ANSI escape sequence to display the entered text in a different color.
<dynamic t=""> <do onchange_="@t" when_="{@t<>''}"> <set t="{'\[32m'}{@t}{'\[39m '}"/> </do> <widget class_="terminal" value_="@t"/> </dynamic>