Keyboard Shortcuts

The full readline-style shortcut table built into TinyCLI

TinyCLI implements a subset of the standard GNU readline shortcuts for line editing, history, and tab-completion. The bindings are fixed and not configurable.

Cursor Movement

ShortcutAction
LeftMove cursor back one character.
RightMove cursor forward one character.
HomeMove cursor to start of line.
EndMove cursor to end of line.
Ctrl+bMove cursor back one character. (Same as Left.)
Ctrl+fMove cursor forward one character. (Same as Right.)
Ctrl+aMove cursor to start of line. (Same as Home.)
Ctrl+eMove cursor to end of line. (Same as End.)
Alt+bMove cursor back one word.
Alt+fMove cursor forward one word.

Deletion

ShortcutAction
DeleteDelete the character under the cursor.
BackspaceDelete the character before the cursor.
Ctrl+dDelete the character under the cursor. (Same as Delete.)
Ctrl+hDelete the character before the cursor. (Same as Backspace.)
Ctrl+kClear from cursor to end of line.
Ctrl+uClear from cursor to start of line.
Ctrl+wClear the word before the cursor.
Alt+dDelete the word after the cursor.

History

Available when TCLI_HISTORY_BUF_LEN > 0 (the default).

ShortcutAction
UpRecall the previous command.
DownRecall the next command.
Ctrl+pRecall the previous command. (Same as Up.)
Ctrl+nRecall the next command. (Same as Down.)
Ctrl+rEnter reverse-search mode.
Ctrl+gExit reverse-search mode (without selecting).
Alt+rCancel any edits to a recalled history line.

Tab-Completion

Available when TCLI_COMPLETE = 1 (the default).

ShortcutAction
TabComplete at cursor; on subsequent presses, cycle through matches.
EscExit tab-completion mode (without choosing a match).

Esc needs to be pressed twice in some terminal contexts, since the byte sequence is otherwise indistinguishable from the start of an ANSI escape sequence the library is reading.

Other

ShortcutAction
Ctrl+cSend SIGINT to the registered handler (if any); otherwise abort the line.
Ctrl+lClear the screen.
Ctrl+iEquivalent to Tab.
Ctrl+jEquivalent to Enter.

Key Name Notation

Alt+x denotes what most terminals transmit as Esc x, i.e. a literal Escape byte followed by x. On a typical terminal this is produced by holding Option or Alt while pressing the corresponding key.