| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
can you add a test for multiple escape characters one after another?
Sorry, something went wrong.
There was a problem hiding this comment.
sure
Sorry, something went wrong.
There was a problem hiding this comment.
This does not return anything. See https://github.com/nodejs/node/blob/ede98a77677afcc5e75a126043a11a720f7ae28b/lib/timers.js -- you can use just use clearTimeout(timeoutRef) without the if or re-assigning.
Sorry, something went wrong.
There was a problem hiding this comment.
@Fishrock123 Yes, I just assigned the undefined return value to timeout object. I'll remove that
Sorry, something went wrong.
|
Looking good on the timeout value part from my side. By the way: changes over time are much easier to review if you don't force push after every change. |
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe just add a comment stating which functions these are mocking?
Sorry, something went wrong.
|
Local testing shows this doing ok. LGTM with green CI but would like others to review also. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Gave it a try. While it seems to work on single escape presses, 2 quick presses seem to get swallowed, 3 quick presses gives me: undefined { sequence: '\u001b\u001b\u001b',
name: 'escape',
ctrl: false,
meta: true,
shift: false }
{ sequence: '',
name: '\u0000',
ctrl: true,
meta: false,
shift: false }
|
Sorry, something went wrong.
|
@silverwind Do we need to reduce timeout value below 500ms? |
Sorry, something went wrong.
|
I don't think the timeout value is the issue, it's what happens when another escape arrives during the timeout. |
Sorry, something went wrong.
|
@nodejs/collaborators Is it good to merge? |
Sorry, something went wrong.
|
I'm fine with this as is but would like @silverwind to be comfortable with it also. |
Sorry, something went wrong.
|
Not really happy that it prints that garbage \u0000 after three escape presses, I'd like to see that fixed at least. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Looking good. Only nit I have a are ESC+ESC and ESC+ESC+ESC entered during the timeout which are given as these keypress events: { sequence: '\u001b\u001b',
name: undefined,
ctrl: false,
meta: false,
shift: false }
{ sequence: '\u001b\u001b\u001b',
name: undefined,
ctrl: false,
meta: false,
shift: false }
Is ESC+ESC a valid escape sequence? If not, maybe we should emit individual events per keypress. Above issue isn't really something that should prevent this from landing. LGTM. |
Sorry, something went wrong.
|
@silverwind As per the existing implementation, meta flag is set for the invalid escape sequences. Updated PR to set meta flag. CI: https://ci.nodejs.org/job/node-test-pull-request/3659/ For the invalid escape sequence, we may need a new PR to emit individual events per keypress as its a breaking change. |
Sorry, something went wrong.
I'd say leave it as is. I can't find any reference that ESC+ESC is not a escape sequence of its own. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
readline
Description of change
Fixes: #7379