From 13ecfa368e5f6f612bf2b2708de53c7f8213d6e9 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Fri, 18 May 2018 23:54:07 +0530 Subject: [PATCH 1/7] doc: adds handeled tty write keybindings Closes: #20814 --- doc/api/readline.md | 4 +- doc/api/tty.md | 102 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index a2a4adf3093a9a..10eeab71ab6171 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 covered key +combinations. If `key` is specified, `data` is ignored. @@ -535,3 +536,4 @@ rl.on('line', (line) => { [TTY]: tty.html [Writable]: stream.html#stream_writable_streams [reading files]: #readline_example_read_file_stream_line_by_line +[`TTY keybindings`]: tty.html#tty_tty_keybindings diff --git a/doc/api/tty.md b/doc/api/tty.md index 91bca8284d9378..2774e55d9c1229 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -158,7 +158,109 @@ The `tty.isatty()` method returns `true` if the given `fd` is associated with a TTY and `false` if it is not, including whenever `fd` is not a non-negative integer. +## TTY keybindings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeybindingsDescription
ctrl+shift+backspacedelete line left
ctrl+shift+deletedelete line right
ctrl+cemits SIGINT
ctrl+hdelete left
ctrl+ddelete right or EOF
ctrl+udelete from current to line start
ctrl+kdelete from current to end of line
ctrl+agoto start of line
ctrl+egoto to end of line
ctrl+bback one character
ctrl+fforward one character
ctrl+lclear screen
ctrl+nnext history item
ctrl+pprev history item
ctrl+z(need clarification)
ctrl+w or ctrl+backspacedelete backwards to a word boundary
ctrl+deletedelete forward to a word boundary
ctrl+leftword left
ctrl+rightword right
meta+bword left
meta+fword right
meta+d or meta+deletedelete word right
meta+backspacedelete word left
+ [`net.Socket`]: net.html#net_class_net_socket [`process.stdin`]: process.html#process_process_stdin [`process.stdout`]: process.html#process_process_stdout [`process.stderr`]: process.html#process_process_stderr +[`TTY keybindings`]: #tty_tty_keybindings From 60165b70a899f71a0ab1cf8a1e40c78ee1b491d9 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Mon, 21 May 2018 13:12:45 +0530 Subject: [PATCH 2/7] doc: add the keybindings to readline doc. Also - 1. Adds ref in repl doc 2. Removes ref from tty doc Closes: #20814 --- doc/api/readline.md | 105 +++++++++++++++++++++++++++++++++++++++++++- doc/api/repl.md | 3 ++ doc/api/tty.md | 104 +------------------------------------------ 3 files changed, 107 insertions(+), 105 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 10eeab71ab6171..67f3ef25c87059 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -287,7 +287,7 @@ 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. See [`TTY keybindings`][] for a list of covered key +a [TTY][] text terminal. See [`TTY keybindings`][] for a list of key combinations. If `key` is specified, `data` is ignored. @@ -528,6 +528,107 @@ rl.on('line', (line) => { }); ``` +## TTY keybindings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeybindingsDescription
ctrl+shift+backspacedelete line left
ctrl+shift+deletedelete line right
ctrl+cemits SIGINT
ctrl+hdelete left
ctrl+ddelete right or EOF
ctrl+udelete from current to line start
ctrl+kdelete from current to end of line
ctrl+agoto start of line
ctrl+egoto to end of line
ctrl+bback one character
ctrl+fforward one character
ctrl+lclear screen
ctrl+nnext history item
ctrl+pprev history item
ctrl+z(need clarification)
ctrl+w or ctrl+backspacedelete backwards to a word boundary
ctrl+deletedelete forward to a word boundary
ctrl+leftword left
ctrl+rightword right
meta+bword left
meta+fword right
meta+d or meta+deletedelete word right
meta+backspacedelete word left
+ [`'SIGCONT'`]: readline.html#readline_event_sigcont [`'SIGTSTP'`]: readline.html#readline_event_sigtstp [`process.stdin`]: process.html#process_process_stdin @@ -536,4 +637,4 @@ rl.on('line', (line) => { [TTY]: tty.html [Writable]: stream.html#stream_writable_streams [reading files]: #readline_example_read_file_stream_line_by_line -[`TTY keybindings`]: tty.html#tty_tty_keybindings +[`TTY keybindings`]: #readline_tty_keybindings diff --git a/doc/api/repl.md b/doc/api/repl.md index 356d5ef47e206f..5cafab776372aa 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -67,6 +67,8 @@ The following key combinations in the REPL have these special effects: variables. When pressed while entering other input, displays relevant autocompletion options. +For a full list of special keys, refer [`TTY keybindings`][]. + ### Default Evaluation By default, all instances of `repl.REPLServer` use an evaluation function that @@ -634,3 +636,4 @@ For an example of running a REPL instance over [curl(1)][], see: [`util.inspect()`]: util.html#util_util_inspect_object_options [curl(1)]: https://curl.haxx.se/docs/manpage.html [stream]: stream.html +[`TTY keybindings`]: readline.html#readline_tty_keybindings diff --git a/doc/api/tty.md b/doc/api/tty.md index 2774e55d9c1229..2993978f8c7a0c 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -158,109 +158,7 @@ The `tty.isatty()` method returns `true` if the given `fd` is associated with a TTY and `false` if it is not, including whenever `fd` is not a non-negative integer. -## TTY keybindings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeybindingsDescription
ctrl+shift+backspacedelete line left
ctrl+shift+deletedelete line right
ctrl+cemits SIGINT
ctrl+hdelete left
ctrl+ddelete right or EOF
ctrl+udelete from current to line start
ctrl+kdelete from current to end of line
ctrl+agoto start of line
ctrl+egoto to end of line
ctrl+bback one character
ctrl+fforward one character
ctrl+lclear screen
ctrl+nnext history item
ctrl+pprev history item
ctrl+z(need clarification)
ctrl+w or ctrl+backspacedelete backwards to a word boundary
ctrl+deletedelete forward to a word boundary
ctrl+leftword left
ctrl+rightword right
meta+bword left
meta+fword right
meta+d or meta+deletedelete word right
meta+backspacedelete word left
- [`net.Socket`]: net.html#net_class_net_socket [`process.stdin`]: process.html#process_process_stdin [`process.stdout`]: process.html#process_process_stdout -[`process.stderr`]: process.html#process_process_stderr -[`TTY keybindings`]: #tty_tty_keybindings +[`process.stderr`]: process.html#process_process_stderr \ No newline at end of file From c39f8b6d8ce04dd46107b5da90703ff56ace56f2 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Thu, 24 May 2018 16:05:06 +0530 Subject: [PATCH 3/7] doc: fixes as per review comments 1. typo fix 2. adding new lines Closes: #20814 --- doc/api/readline.md | 10 +++++----- doc/api/repl.md | 5 +++-- doc/api/tty.md | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 67f3ef25c87059..ade6d06343a548 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -545,7 +545,7 @@ rl.on('line', (line) => { ctrl+c - emits SIGINT + emit SIGINT ctrl+h @@ -565,11 +565,11 @@ rl.on('line', (line) => { ctrl+a - goto start of line + go to start of line ctrl+e - goto to end of line + go to to end of line ctrl+b @@ -589,7 +589,7 @@ rl.on('line', (line) => { ctrl+p - prev history item + previous history item ctrl+z @@ -635,6 +635,6 @@ rl.on('line', (line) => { [`process.stdout`]: process.html#process_process_stdout [Readable]: stream.html#stream_readable_streams [TTY]: tty.html +[TTY keybindings]: #readline_tty_keybindings [Writable]: stream.html#stream_writable_streams [reading files]: #readline_example_read_file_stream_line_by_line -[`TTY keybindings`]: #readline_tty_keybindings diff --git a/doc/api/repl.md b/doc/api/repl.md index 5cafab776372aa..aedbd86185f26c 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -67,7 +67,7 @@ The following key combinations in the REPL have these special effects: variables. When pressed while entering other input, displays relevant autocompletion options. -For a full list of special keys, refer [`TTY keybindings`][]. +For a full list of special keys, refer to [TTY keybindings][]. ### Default Evaluation @@ -634,6 +634,7 @@ For an example of running a REPL instance over [curl(1)][], see: [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function [`readline.Interface`]: readline.html#readline_class_interface [`util.inspect()`]: util.html#util_util_inspect_object_options +[TTY keybindings]: readline.html#readline_tty_keybindings [curl(1)]: https://curl.haxx.se/docs/manpage.html [stream]: stream.html -[`TTY keybindings`]: readline.html#readline_tty_keybindings + diff --git a/doc/api/tty.md b/doc/api/tty.md index 2993978f8c7a0c..91bca8284d9378 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -161,4 +161,4 @@ integer. [`net.Socket`]: net.html#net_class_net_socket [`process.stdin`]: process.html#process_process_stdin [`process.stdout`]: process.html#process_process_stdout -[`process.stderr`]: process.html#process_process_stderr \ No newline at end of file +[`process.stderr`]: process.html#process_process_stderr From 2faec192a6a17e45ee1aba618c361de8bac2238f Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Thu, 24 May 2018 23:21:03 +0530 Subject: [PATCH 4/7] doc: highlighting code + capital case description refs: #20814 --- doc/api/readline.md | 90 ++++++++++++++++++++++----------------------- doc/api/repl.md | 1 - 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index ade6d06343a548..a560a924dd1373 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -536,96 +536,96 @@ rl.on('line', (line) => { Description - ctrl+shift+backspace - delete line left + ctrl + shift + backspace + Delete line left - ctrl+shift+delete - delete line right + ctrl + shift + delete + Delete line right - ctrl+c - emit SIGINT + ctrl + c + Emit SIGINT - ctrl+h - delete left + ctrl + h + Delete left - ctrl+d - delete right or EOF + ctrl + d + Delete right or EOF - ctrl+u - delete from current to line start + ctrl + u + Delete from current to line start - ctrl+k - delete from current to end of line + ctrl + k + Delete from current to end of line - ctrl+a - go to start of line + ctrl + a + Go to start of line - ctrl+e - go to to end of line + ctrl + e + Go to to end of line - ctrl+b - back one character + ctrl + b + Back one character - ctrl+f - forward one character + ctrl + f + Forward one character - ctrl+l - clear screen + ctrl + l + Clear screen - ctrl+n - next history item + ctrl + n + Next history item - ctrl+p - previous history item + ctrl + p + Previous history item - ctrl+z + ctrl + z (need clarification) - ctrl+w or ctrl+backspace - delete backwards to a word boundary + ctrl + w   or   ctrl + backspace + Delete backwards to a word boundary - ctrl+delete - delete forward to a word boundary + ctrl + delete + Delete forward to a word boundary - ctrl+left - word left + ctrl + left + Word left - ctrl+right - word right + ctrl + right + Word right - meta+b - word left + meta + b + Word left - meta+f - word right + meta + f + Word right - meta+d or meta+delete - delete word right + meta + d   or   meta + delete + Delete word right - meta+backspace - delete word left + meta + backspace + Delete word left diff --git a/doc/api/repl.md b/doc/api/repl.md index aedbd86185f26c..bde5cbd40affaa 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -637,4 +637,3 @@ For an example of running a REPL instance over [curl(1)][], see: [TTY keybindings]: readline.html#readline_tty_keybindings [curl(1)]: https://curl.haxx.se/docs/manpage.html [stream]: stream.html - From e3d38dd35ae534c641ce57cecbf82405ae7b079e Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Thu, 24 May 2018 23:23:04 +0530 Subject: [PATCH 5/7] doc: fixes typo refs: #20814 --- doc/api/readline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index a560a924dd1373..09c93462aa02b3 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -287,7 +287,7 @@ 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. See [`TTY keybindings`][] for a list of key +a [TTY][] text terminal. See [TTY keybindings][] for a list of key combinations. If `key` is specified, `data` is ignored. From 76d462c2a5068cb365211ca52c1aa6787b6cfc9d Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Sat, 26 May 2018 15:13:05 +0530 Subject: [PATCH 6/7] doc: adds description for ctrl+z refs: #20814 --- doc/api/readline.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 09c93462aa02b3..be041827d5e315 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -581,7 +581,7 @@ rl.on('line', (line) => { ctrl + l - Clear screen + Clear screen ctrl + n @@ -589,11 +589,11 @@ rl.on('line', (line) => { ctrl + p - Previous history item + Previous history item ctrl + z - (need clarification) + Moves running process into background. Type fg and press enter to return. ctrl + w   or   ctrl + backspace From 67e3d92dde97dc325717ce7813e7cf6ef789f8d7 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Sun, 27 May 2018 21:30:19 +0530 Subject: [PATCH 7/7] doc: fixes line warnings + removes nbsp; refs: #20814 --- doc/api/readline.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index be041827d5e315..88f369c6541872 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -593,10 +593,13 @@ rl.on('line', (line) => { ctrl + z - Moves running process into background. Type fg and press enter to return. + Moves running process into background. Type + fg and press enter + to return. - ctrl + w   or   ctrl + backspace + ctrl + w or ctrl + + backspace Delete backwards to a word boundary @@ -620,7 +623,8 @@ rl.on('line', (line) => { Word right - meta + d   or   meta + delete + meta + d or meta + + delete Delete word right