termu command

The termu BASIC program automatically updates the term width and depth.

Syntax

 termu tw,td,ls,ld,fd,bs,pw,pd,tt {(options)}
 termu tt {(options)}

Parameter(s)

tw The option for terminal width: the number of print positions per line on the terminal. This number must be between 10 and 140.

Although most terminals are capable of printing 80 characters per line, the typical setting is 79 to avoid problems with carriage return/line feeds when displaying at the 80th position.

td The option for terminal depth, in lines.
ls The option for line skip: the number of blank lines at the bottom of the screen. The value in the td option is added to the value in the ls option, and must equal the actual number of lines on the terminal.
ld The option for linefeed delays: the number of null characters to output after each line feed. This is typically set to 0.
fd The option for form feed delays: the number of null characters to output after a top-of-form command is executed.

The fd parameter also determines when to eject a page (or clear the screen) between output pages. These settings are valid:

0 Suppresses page ejects between output pages on both the terminal and the printer.

If set to 0, pads with an LF.

1 Suppresses page ejects on the terminal only.

If set to 1, pads with a CRLF.

2 (Normal mode) Any value of two or more clears the screen (or ejects a page on the printer), and sends the corresponding number of nulls.
bs The Backspace key value: the decimal value of the ASCII character to echo to the terminal when the Backspace key is pressed. This is typically set to 8 or 21.
pw The current printer width or the number of print positions per line on printer output.
pd The printer depth or the number of lines per page on printer output.
tt The terminal type code: designates the terminal driver to use . This is vital to set prior to invoking any process, which attempts to perform any kind of cursor control, such as the Update processor, FlashBASIC, or PROC.
options c Recompiles the terminal definition from the source.
h Sets high-intensity.
k Sets the input/output terminal translation table. The name of table is defined in the fourth value of the attribute 1 of the devices item. The name of the translation table is the item-ID of an item in the keyboards file.
r Redisplays resulting term parameters after changing.

Description

The termu command is the default value for the sigwinch signal of the trap command.
  • In UNIX, this is done by reading the values from the UNIX stty command.
  • In Windows, this is done by capturing the Telnet options that determine window height and width.

Any parameter can be left intact by entering a null (two consecutive commas). The only exception to this rule is the tt (terminal type) parameter, which defines the terminal name. The system recognizes terminal names, so the name can be entered first or last.

The terminal type parameter can be specified without any other arguments, or in any position of the argument list, since it is the only non-numeric argument.

The terminal driver definitions are located in the dm,devices, file. To obtain a listing of the available types, type:

 sort only dm,devices,

Terminal types in D3 use descriptive names, rather than just a single alphabetical character.

Note: To flash compile the term command, the C-compiler is required.

Example(s)

This example illustrates using termu to read and apply the term width and depth from the UNIX stty command.

 :term 80,24
 terminal name: vt100
 product name: VT100
 terminal width: 80   printer width: 80
          depth: 24           depth: 59
 lineskip:    0
 lf delay:    1
 ff delay:    1
 back space:  8
 :stty -a
 speed 9600 baud; 25 rows; 119 columns;
 eucw 1:1:0:0, scrw 1:1:0:0:
 intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@
 eol2 = ^@; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R
 discard = ^O; werase = ^W; lnext = ^V
 -parenb -parodd cs8 -cstopb -hupcl cread clocal -parext
 -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
 -ixon -ixany -ixoff imaxbel
 isig icanon -xcase echo echoe echok -echonl -noflsh
 -tostop echoctl -echoprt echoke -flusho -pending iexten
 opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
 :termu
 :term
 terminal name: vt100
 product name: VT100
 terminal width: 119    printer width: 80
          depth: 25             depth: 59
 lineskip:    0
 lf delay:    1
 ff delay:    1
 back space:  8