-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: document readline keybindings #20825
Changes from 1 commit
13ecfa3
60165b7
c39f8b6
2faec19
e3d38dd
76d462c
67e3d92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we document these in the readline doc? While a TTY is required for most of these, they shouldonly affect readline behaviour There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it would be fine to add a reference to those in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shobhitchittora Yes, that’s the idea (although I don’t really understand why this would be added to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @addaleax I saw this code in readline - Interface.prototype.write = function(d, key) {
if (this.paused) this.resume();
this.terminal ? this._ttyWrite(d, key) : this._normalWrite(d);
}; and thought that TTY case need a doc. But yeah we can have the table in Need you opinion on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, exactly – it’s code in readline. :) We should point out that these codes apply only for TTYs, but it’s not something that’s interesting for code that uses TTYs in general. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @addaleax you are right, the TTY docs are actually the wrong place for this. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
<table> | ||
<tr> | ||
<th>Keybindings</th> | ||
<th>Description</th> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+shift+backspace</code></td> | ||
<td>delete line left</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+shift+delete</code></td> | ||
<td>delete line right</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+c</code></td> | ||
<td>emits SIGINT</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+h</code></td> | ||
<td>delete left</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+d</code></td> | ||
<td>delete right or EOF</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+u</code></td> | ||
<td>delete from current to line start</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+k</code></td> | ||
<td>delete from current to end of line</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+a</code></td> | ||
<td>goto start of line</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+e</code></td> | ||
<td>goto to end of line</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+b</code></td> | ||
<td>back one character</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+f</code></td> | ||
<td>forward one character</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+l</code></td> | ||
<td>clear screen </td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+n</code></td> | ||
<td>next history item</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+p</code></td> | ||
<td>prev history item </td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+z</code></td> | ||
<td>(need clarification)</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+w</code> or <code>ctrl+backspace</code></td> | ||
<td>delete backwards to a word boundary</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+delete</code></td> | ||
<td>delete forward to a word boundary</td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+left</code></td> | ||
<td>word left </td> | ||
</tr> | ||
<tr> | ||
<td><code>ctrl+right</code></td> | ||
<td>word right</td> | ||
</tr> | ||
<tr> | ||
<td><code>meta+b</code></td> | ||
<td>word left</td> | ||
</tr> | ||
<tr> | ||
<td><code>meta+f</code></td> | ||
<td>word right</td> | ||
</tr> | ||
<tr> | ||
<td><code>meta+d</code> or <code>meta+delete</code></td> | ||
<td>delete word right</td> | ||
</tr> | ||
<tr> | ||
<td><code>meta+backspace</code></td> | ||
<td>delete word left </td> | ||
</tr> | ||
</table> | ||
|
||
[`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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove "covered"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.