-
Notifications
You must be signed in to change notification settings - Fork 30k
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
readline: undo previous edit when get key code 0x1F
#41392
Conversation
1. Undo previous edit on keystroke `ctrl -` (emit 0x1F) 2. unittests 3. documentation
This PR and #41301 are conflicting. Once one of them is accepted, I'll update the other. |
Which PR do you want to land first? this or #41301? |
Either would be OK. Just let me know. Thank you! |
Okay, I plan to land this PR first, then #41301. |
Commit Queue failed- Loading data for nodejs/node/pull/41392 ✔ Done loading data for nodejs/node/pull/41392 ----------------------------------- PR info ------------------------------------ Title readline: undo previous edit when get key code `0x1F` (#41392) Author Ray (@rayw000) Branch rayw000:feature-undo-redo -> nodejs:master Labels readline, author ready, needs-ci Commits 2 - readline: undo previous edit when get key code 0x1F - readline: remove redundant code Committers 1 - Ray Wang PR-URL: https://github.com/nodejs/node/pull/41392 Fixes: https://github.com/nodejs/node/issues/41308 Reviewed-By: James M Snell Reviewed-By: Qingyu Deng ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41392 Fixes: https://github.com/nodejs/node/issues/41308 Reviewed-By: James M Snell Reviewed-By: Qingyu Deng -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 04 Jan 2022 06:23:39 GMT ✔ Approvals: 2 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/41392#pullrequestreview-854802340 ✔ - Qingyu Deng (@Ayase-252): https://github.com/nodejs/node/pull/41392#pullrequestreview-859251418 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-01-21T03:57:00Z: https://ci.nodejs.org/job/node-test-pull-request/42063/ - Querying data for job/node-test-pull-request/42063/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 41392 From https://github.com/nodejs/node * branch refs/pull/41392/merge -> FETCH_HEAD ✔ Fetched commits as ef3517552797..c3475d0637dc -------------------------------------------------------------------------------- Auto-merging doc/api/readline.md [master 1809a4668c] readline: undo previous edit when get key code 0x1F Author: Ray Wang Date: Wed Jan 5 20:06:26 2022 +0800 3 files changed, 96 insertions(+) [master dee886c43c] readline: remove redundant code Author: Ray Wang Date: Tue Jan 18 15:48:42 2022 +0800 1 file changed, 2 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/1727762702 |
Landed in 271725a |
1. Undo previous edit on keystroke `ctrl -` (emit 0x1F) 2. unittests 3. documentation PR-URL: nodejs#41392 Fixes: nodejs#41308 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Qingyu Deng <i@ayase-lab.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@rayw000 there are test failures when landing this in |
No problem. @danielleadams |
@danielleadams I didn't see something unusual in my local env. What kind of failures did you encounter? Would you please provide more details? Thank you. |
@rayw000 For sure. I cherry-picked 271725a onto the
|
@rayw000 If you have successfully cherry-picked your commit on top of |
Now I can repro this on fakeInput.emit('keypress', '.', { sequence: '\x1F' }); Cherry-picking |
If that helps you can open a backport PR for more than one commit – there's probably another commit (or maybe several other commits) that landed on |
OK. Does it mean that I can leave that backport PR open (or keep it a draft) to avoid this PR being merged into this release? |
Danielle added |
Got it. Thank you! |
ctrl -
(emit0x1F
)Fix: #41308
By now, we have
ctrl -
to performundo
. In many terminals, all ofctrl -
,ctrl _
,ctrl /
andctrl ?
send key code0x1F
, so we cannot distinguish if we are pressingshift
to performredo
.My questions are:
0x1F
on keystrokectrl _
?Could someone help me out? Thanks!