Technical data
When the terminal line discipline and terminal codeset characteristics are
set appropriately for multibyte codesets, the atty driver handles command
line editing appropriately for languages supported by those codesets.
For example, when you enter the control sequence to delete a character
(assuming you have defined the control sequence), the entire character is
deleted, regardless of how many bytes it occupies. The character being
erased can be either a single-byte character or a multibyte Asian character
when both occur on the same command line.
Word deletion is also supported, even when words combine single-byte and
multibyte characters. The atty driver accepts single-byte space characters,
2-byte space characters (if applicable to the terminal code setting), or tab
characters as word delimiters.
The erase and werase options of the stty command line let you define the
control sequence for character and word deletion. For example:
% stty erase Ctrl/h
% stty werase Ctrl/j
This example specifies that Ctrl/h deletes the character preceding the cursor
and Ctrl/j deletes the word preceding the cursor.
History mode is a mode of command line editing that allows you to recall
and optionally modify a command entered previously. The history mode
implementation discussed here is one that is customized for Japanese,
Chinese, and Korean input and supported only for the BSD terminal driver.
Table 2–3 specifies the stty options that enable or disable history mode
editing for these languages. See Table 2–6 for stty options that control
history mode for the Thai language.
Table 2–3: The stty Options Used with atty to Enable and Disable History
Mode
stty Option
Description
history key
Sets the toggle key for the history mecha-
nism and enables it.
−history
Disables the history mechanism.
The atty driver can maintain a history of up to 32 commands, each with a
maximum length of 127 characters. Table 2–4 describes the commands you
can use to edit command lines after entering the history key.
2–10 Using Asian Input Methods and Terminal Drivers










