Display or set the terminal type (QNX)
termdef [-c command] [-I] [-e] [terminal_type] termdef -s [terminal_type] termdef - [terminal_type]
The termdef utility is used for setting and querying the terminal type. It can be used from tinit, where it will establish the terminal type and then exec() into another command (usually login). It can also be used inside the Shell to set or query the terminal type currently being used (termdef - or termdef -s).
Using the specified terminal type (or the type currently defined by the TERM environment variable if -e is given), termdef:
Having configured the tty, termdef exec()s into a command that inherits the TERM environment variable from termdef. By default, this command is:
/bin/login -p
To use another command, you specify the -c option.
If a terminal type isn't specified or if -e isn't given, the user will be prompted for the terminal type. The user can obtain a list of valid terminal types by pressing Enter or by entering an invalid terminal type.
Specifying the -e option or a terminal type on the command line normally prevents the user from being prompted. However, if the terminal type defined by TERM is invalid, termdef displays a warning message and the user is prompted for a terminal type, as if -e weren't specified.
When invoked without the - or -s options, termdef establishes a terminal type and exec()s into another command (login, by default).
You can use termdef from the Shell in a manner similar to the UNIX tset utility. To display the current terminal type, use:
termdef -
To change the terminal type, use one of the following:
This command: | Will: |
---|---|
termdef - terminal_type | write the new terminal_type to the standard output |
termdef -s terminal_type | write the Shell command for setting TERM to the standard output |
termdef -s | do the same as the above command but prompt for the terminal type |
Set up ser2 and ser3 to prompt for a terminal type, and exec() into login once the terminal type is established:
tinit -c "termdef" -T ser2 ser3 &
Assuming ser1 has a VT100 terminal on it (hardwired), have termdef set up the tty and TERM variable, then exec() into login, without prompting for terminal type:
tinit -c "termdef vt100" -T ser1 &
or
tinit -c "termdef -e" -T ser1 TERM=vt100 &
Display the terminal type:
termdef -
or
echo $TERM
Change the terminal type to VT100:
export TERM=`termdef - vt100`
or
`termdef -s vt100`
Prompt the user to specify a new terminal type:
`termdef -s`