PTERM

PTERM

Top  Previous  Next

 

The PTERM command sets or displays terminal characteristics.

 

 

Format

 

PTERM BINARY { ON  | OFF }

PTERM BREAK { ON  | OFF }

PTERM BREAK { n | ^c }

PTERM CASE { INVERT  | NOINVERT }

PTERM CODEPAGE { page }

PTERM CTRL.FILTER { ON | OFF }

PTERM ENCODING name

PTERM ERASE {ON | OFF | n | ^c}

PTERM MARK { ON | OFF }

PTERM NEWLINE { CR  | LF  | CRLF }

PTERM PROMPT "string1" { "string2" }

PTERM QUERY

PTERM RESET string

PTERM RETURN { CR  | LF }

PTERM DISPLAY

PTERM LPTR

 

Multiple options from the above may be included in a single command.

 

 

The PTERM BINARY ON or OFF command determines whether terminal input/output is processed by QM to handle special character transformation rules appropriate to a telnet connection. When binary mode is enabled, all data is passed in/out without any modification.

 

The PTERM BREAK ON or OFF command determines whether use of the break key is considered to be a break or a data character. If set on, the break key will interrupt processing. If set off, the break key is treated as a normal data character. The setting of this mode does not affect interpretation of the telnet break command.

 

The PTERM BREAK n or ^c command sets the character to be used as the break key. The first form takes the character number (1 - 31); the second form takes the printable character associated with the control key (A - Z, [, \, ], ^, _). The default break character is ctrl-C (character 3). Note that some terminal emulators send a telnet negotiation parameter instead of the break character itself and may require changes to the emulator configuration to use an alternative character.

 

The PTERM CASE command determines whether the case of alphabetic characters is inverted on entry at the keyboard. Running with case inversion enabled may be useful in a development environment as, for historic reasons, command lines tend to be entered in upper case. In QMBasic programs, case inversion affects INPUT statements, the KEYCODE() and KEYINC() functions but not the KEYIN() function. The initial state of case inversion is set by the INVCASE configuration parameter.

 

The PTERM CODEPAGE command, available only in Windows console sessions, displays or sets the code page used to determine how single byte characters are displayed. The codepage setting is irrelevant to ECS mode systems.

 

The PTERM CTRL.FILTER command enables or disables filtering of control characters in INPUT and INPUT@ other than those that are defined as edit keys. This setting is maintained separately for each command processor level.

 

The PTERM ENCODING command specifies the character encoding used by the terminal device. The only encoding names allowed at UTF8 to set UTF-8 multi-byte character encoding and 8BIT to set the default unencoded 8 bit character set. The encoding is ignored for Windows QMConsole sessions. See also the -utf8 command line option.

 

The PTERM ERASE command sets the erase (backspace) key for the QMBasic INPUT statement. The initial value for this key is taken from kbs element of the terminfo definition for the terminal type in use. The OFF qualifier to PTERM ERASE disables recognition of the erase key. The ON qualifier sets the erase key to character 8 (ctrl-H) which corresponds to the backspace key on most terminal types. Use of n or ^c sets the erase character to a user specified value. The first form takes the character number (1 - 31 or 127); the second form takes the printable character associated with the control key (A - Z, [, \, ], ^, _). Note that setting the erase character to 127 (the Delete key) also requires that the kdch1 element of the relevant terminfo definition is removed or modified so that this key does not clash with its internal processing as a forward delete. Note that the INPUT@ statement which supports extended editing capabilities always uses the terminfo definition for the erase key.

 

The PTERM MARK command can be used to enable a mark character translation feature whereby entry of characters 28 - 30 (ctrl-\, ctrl-], ctrl-^) at the keyboard gets translated to subvalue, value and field marks respectively. Used without the ON or OFF qualifier, this command shows the current state. Translation is off by default.

 

The PTERM NEWLINE command determines whether QM sends CR, LF or a CR/LF pair as the newline sequence on terminal output. The default mode is CRLF.

 

The PTERM PROMPT command changes the command prompt from the default colon to string1. The optional string2 changes the alternative prompt displayed when the default select list is active. The prompt strings must be quoted and may be from 1 to 10 characters in length.

 

The PTERM QUERY command can be used to determine what codes specific keys send. It is a valuable tool when constructing terminfo definitions. The command waits for a key to be pressed and then displays the characters received by the QM system in hexadecimal form and as a character if printable. If the key sequence includes characters that suggest this might be a key that could be bound in terminfo, the corresponding terminfo definition string is also displayed. To exit from this PTERM mode, enter a space.

 

The PTERM RESET command sets a control string to be sent to the terminal device on return to the command prompt. This can be used, for example, to ensure that the terminal reverts to a chosen foreground/background colour scheme regardless of how the application left it set. The string may include use of the QMBasic style @() function to insert device dependent control codes or any of the following special codes:

\BBackspace
\EEscape
\FForm feed
\NNewline
\RCarriage return
\TTab
\^^
\\\
^xCtrl-x

 

The PTERM RETURN command determines whether KEYIN() and related QMBasic functions return 10 (LF) or 13 (CR) when the return key is pressed. The actual effect of this mode setting is to replace incoming carriage returns with the given character unless the session is operating over a binary mode telnet connection. The default mode is CR.

 

The PTERM DISPLAY command reports the current settings of the terminal. PTERM LPTR directs the same report to the default printer.

 

 

See also:

PTERM(), TERM