In “line-editing mode” most keystrokes add to or modify an editing area in the domterm window, but are not sent to the application until you type Enter. This enables editing of input lines similar to GNU readliune.
ctrl-shift-L cycles between char mode (most
characters sent immeditably to the application),
line mode (most characaters modify local editring area), and
auto mode (automatically switches between char mode and line mode
depending on whether the application requests “raw” (char) input
or “canonical” (line) input).
The following special keys are supported.
N is a repeat count, which by default is 1.
The word “caret” refers to the text cursor
(as opposed to the mouse cursor).
The names in parentheses are the corresponding action names that
can be used if changing the key-bindings.
N characters left or right.
N words left or right.
Move caret to start/end of line.
Extends the current selection by one character. (If there is no selection, the caret position is treated as a zero-size selection.)
Extends the current selection by one word.
Extend selection to start/end of line.
N characters to the left or right of the caret.
N words to the left or right of the caret.
Send input line to application. Also, if line is non-empty, add it to the history list.
Copy selection to clipboard. (Selection can be partly or fully outside input area.)
Paste selection from clipboard.
Cut (deleted) selection and copy to clipboard. The selection should be wholly within the input area.
Move up/down in history. If the current command is multi-line, first moves within the current command before moving to commands in the history.
Set or extend a repeat count.
Alt-1 Alt-2 Left moves 12 characters left, while
Alt-Minus Alt-2 Ctrl-Left moves 2 words right (because of the minus).
Emacs-style alternate keybindings.
The “standard” mouse commands should work as expected. If you click before/after the input area, the caret is moved to the start/end of the input area.
Not implemented yet, but planned:
Handle multi-line input areas. (
Shift-Enter would add
a newline to the input area, without sending anything to the application.)
Emacs-style key-bindings should be controlled by a separate option;
some bindings are missing, such as
and the ones prefixed by
Command-completion, using some protocol to be defined.
A plug-in replacement for GNU
would be nice. (The idea is for an enhanced readline to detect it is running
under DomTerm, in which case it would delegate most editing to DomTerm.
This would allow using bash completion logic.)
Auto-completion (completion as you type).
Ctrl-R key enters history-search mode.
As you type characters, a search string is created, which
is matched against the items in the history list.
Append (or insert)
printable-char to the search string,
which may update the selected history item.
Move caret within search string.
Delete character from search string. This may change the selected history item.
Search for previous/next history item matching the current search string.
If the search string is empty, use previous search string.
Ctrl-R Ctrl-R repeats previous search.
Exit search mode, accept current item, and send it to the application.
Exit search mode, and move to previous/next history item.
Exit search mode, accept current item, but continue editing it.
You can override the keymap (map from keystrokes to action)
used for input line editing (but not yet override other key-bindings).
keymap.line-edit is a list (separated by commas or newlines),
where each item is a quoted keystroke string, followed by a colon,
followed by an action name. An action name is a string,
but quotes are optional. The following example disables
the binding for
Ctrl-A and adds a binding that
Ctrl-H to the
keymap.line-edit = | "Ctrl-A": ignore-action | 'Ctrl-H': beginning-of-line
A “password field” is an input area where the typed characters
are hidden or obscured. DomTerm will display each character
as a black circle instead of the actual character.
(The replacement character is the
The most recently typed character is displayed briefly (depending on
passwordShowCharTimeout property) before it too is replaced
by a black circle.
On Enter, all circles are removed.
Using these circles makes it easier see how many characters you’ve typed, and to move around using the mouse or cursor keys.
A password field is automatically created when we’re in line-editing mode and echoing is turned off by the program reading the input.