Linux command
tset 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize the terminal
tset
Reset the terminal
reset
Set terminal type
tset [xterm-256color]
Print shell commands
tset -s
Set the erase character
tset -e ^H
Set the interrupt character
tset -i ^C
Skip sending initialization
tset -I
Quiet mode
tset -q
说明
tset initializes the terminal according to the terminal type specified in the $TERM environment variable or on the command line. It sets terminal modes, sends initialization strings, and can configure special characters like erase and kill. If neither -c nor -w is specified, both are assumed. When invoked as reset, the command sets terminal modes to "sane" values: enables cooked and echo modes, disables raw mode, enables newline translation, and resets special characters to defaults. This is useful for recovering from programs that leave the terminal in an abnormal state. The command determines terminal type by checking: command-line argument, $TERM variable, /etc/ttys entry (on BSD), or the default type "unknown". It then sends appropriate initialization sequences from the terminfo database. The -s option outputs shell commands to set TERM, useful in login scripts when the terminal type may change.
参数
- -c
- Set control characters and modes
- -e _ch_
- Set the erase character to ch
- -i _ch_
- Set the interrupt character to ch
- -k _ch_
- Set the line kill character to ch
- -I
- Do not send terminal or tab initialization strings
- -m _mapping_
- Map port type and baud rate to terminal type
- -Q
- Do not display erase, interrupt, and kill characters
- -q
- Display terminal type to stdout without initializing the terminal
- -r
- Print terminal type to stderr
- -s
- Print shell commands to set TERM environment variable
- -V
- Print ncurses version and exit
- -w
- Resize window to match size deduced via setupterm
FAQ
What is the tset command used for?
tset initializes the terminal according to the terminal type specified in the $TERM environment variable or on the command line. It sets terminal modes, sends initialization strings, and can configure special characters like erase and kill. If neither -c nor -w is specified, both are assumed. When invoked as reset, the command sets terminal modes to "sane" values: enables cooked and echo modes, disables raw mode, enables newline translation, and resets special characters to defaults. This is useful for recovering from programs that leave the terminal in an abnormal state. The command determines terminal type by checking: command-line argument, $TERM variable, /etc/ttys entry (on BSD), or the default type "unknown". It then sends appropriate initialization sequences from the terminfo database. The -s option outputs shell commands to set TERM, useful in login scripts when the terminal type may change.
How do I run a basic tset example?
Run `tset` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c do in tset?
Set control characters and modes