diff --git a/doc/api/readline.md b/doc/api/readline.md index a2a4adf3093a9a..88f369c6541872 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -287,7 +287,8 @@ added: v0.1.98 The `rl.write()` method will write either `data` or a key sequence identified by `key` to the `output`. The `key` argument is supported only if `output` is -a [TTY][] text terminal. +a [TTY][] text terminal. See [TTY keybindings][] for a list of key +combinations. If `key` is specified, `data` is ignored. @@ -527,11 +528,117 @@ rl.on('line', (line) => { }); ``` +## TTY keybindings + +
Keybindings | +Description | +
---|---|
ctrl + shift + backspace |
+ Delete line left | +
ctrl + shift + delete |
+ Delete line right | +
ctrl + c |
+ Emit SIGINT | +
ctrl + h |
+ Delete left | +
ctrl + d |
+ Delete right or EOF | +
ctrl + u |
+ Delete from current to line start | +
ctrl + k |
+ Delete from current to end of line | +
ctrl + a |
+ Go to start of line | +
ctrl + e |
+ Go to to end of line | +
ctrl + b |
+ Back one character | +
ctrl + f |
+ Forward one character | +
ctrl + l |
+ Clear screen | +
ctrl + n |
+ Next history item | +
ctrl + p |
+ Previous history item | +
ctrl + z |
+ Moves running process into background. Type
+ fg and press enter
+ to return. |
+
ctrl + w or ctrl
+ + backspace |
+ Delete backwards to a word boundary | +
ctrl + delete |
+ Delete forward to a word boundary | +
ctrl + left |
+ Word left | +
ctrl + right |
+ Word right | +
meta + b |
+ Word left | +
meta + f |
+ Word right | +
meta + d or meta
+ + delete |
+ Delete word right | +
meta + backspace |
+ Delete word left | +