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
| Shortcut | Action |
|---|---|
| Left | Move cursor back one character. |
| Right | Move cursor forward one character. |
| Home | Move cursor to start of line. |
| End | Move cursor to end of line. |
| Ctrl+b | Move cursor back one character. (Same as Left.) |
| Ctrl+f | Move cursor forward one character. (Same as Right.) |
| Ctrl+a | Move cursor to start of line. (Same as Home.) |
| Ctrl+e | Move cursor to end of line. (Same as End.) |
| Alt+b | Move cursor back one word. |
| Alt+f | Move cursor forward one word. |
Deletion
| Shortcut | Action |
|---|---|
| Delete | Delete the character under the cursor. |
| Backspace | Delete the character before the cursor. |
| Ctrl+d | Delete the character under the cursor. (Same as Delete.) |
| Ctrl+h | Delete the character before the cursor. (Same as Backspace.) |
| Ctrl+k | Clear from cursor to end of line. |
| Ctrl+u | Clear from cursor to start of line. |
| Ctrl+w | Clear the word before the cursor. |
| Alt+d | Delete the word after the cursor. |
History
Available when TCLI_HISTORY_BUF_LEN > 0 (the default).
| Shortcut | Action |
|---|---|
| Up | Recall the previous command. |
| Down | Recall the next command. |
| Ctrl+p | Recall the previous command. (Same as Up.) |
| Ctrl+n | Recall the next command. (Same as Down.) |
| Ctrl+r | Enter reverse-search mode. |
| Ctrl+g | Exit reverse-search mode (without selecting). |
| Alt+r | Cancel any edits to a recalled history line. |
Tab-Completion
Available when TCLI_COMPLETE = 1 (the default).
| Shortcut | Action |
|---|---|
| Tab | Complete at cursor; on subsequent presses, cycle through matches. |
| Esc | Exit 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
| Shortcut | Action |
|---|---|
| Ctrl+c | Send SIGINT to the registered handler (if any); otherwise abort the line. |
| Ctrl+l | Clear the screen. |
| Ctrl+i | Equivalent to Tab. |
| Ctrl+j | Equivalent 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.