termdef
Display or set the terminal type (QNX)
Syntax:
termdef [-c command] [-I] [-e] [terminal_type]
termdef -s [terminal_type]
termdef - [terminal_type]
Runs on:
QNX OS
Options:
- -
- Write the current terminal type to the standard output. If a terminal type is specified, write the new type to the standard output.
- -c command
- After setting up the terminal type, start up command instead of invoking the /bin/login -p command.
- -e
- Instead of prompting for a terminal type, use the terminal type currently defined by the TERM environment variable. With this option, termdef leaves the TERM variable alone, but sends any necessary initialization sequences to the terminal and sets the appropriate stty sequences for command-line editing.
- -I
- Don't send terminal initialization sequences. When -I isn't given, termdef writes any terminal initialization sequences to the standard output, if required for the terminal type.
- -s
- Write to the standard output the Shell command for setting TERM to the new terminal type. If no terminal type is specified, you'll be prompted for one. If you enclose the termdef command in backquotes, this option will let you set the TERM variable without exiting the Shell (see examples).
- terminal_type
- The terminal type to be used. If terminal_type is included, the user isn't prompted for a terminal type. This overrides the -e option.
Description:
The termdef utility is used for setting and querying the terminal type, using (termdef - or termdef -s) from the shell.
- sets the TERM variable
- sends any necessary terminal initialization sequences to the terminal
- sets the stty sequences for command-line editing
/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).
Using termdef from the shell
termdef -
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 |
Examples:
Command-line examples
termdef -
or:
echo $TERM
export TERM=`termdef - vt100`
or:
`termdef -s vt100`
`termdef -s`
Exit status:
- 0
- The termdef command was started with valid command parameters, but may or may not have been successful. If unsuccessful, termdef writes diagnostic messages to standard error.
- >0
- Invalid command-line options were supplied.