GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl,readline: improve unicode support and tab completion by BridgeAR · Pull Request #31288 · nodejs/node

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Jan 9, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  1. This reduces the number of write operations used during tab
    completion.
  2. The tab completion calculated the string width using the length
    of the string instead of using the actual width. That is fixed.
  3. The key decoder is now capable of handling characters composed
    out of two code points. That reduces the number of "keypress"
    events that are emitted which again lowers the amount of writes
    triggered.

This is currently blocked by #31112 (moving the charLengthAt function).

// cc @nodejs/repl @nodejs/readline

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lin7sh and bricss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@BridgeAR BridgeAR added the blocked PRs that are blocked by other issues or PRs. label Jan 9, 2020
@nodejs-github-bot nodejs-github-bot added the readline Issues and PRs related to the built-in readline module. label Jan 9, 2020
@BridgeAR BridgeAR added performance Issues and PRs related to the performance of Node.js. repl Issues and PRs related to the REPL subsystem. and removed performance Issues and PRs related to the performance of Node.js. labels Jan 9, 2020
jasnell
jasnell approved these changes Jan 10, 2020
View reviewed changes
@BridgeAR BridgeAR removed the blocked PRs that are blocked by other issues or PRs. label Jan 10, 2020
@BridgeAR
readline: improve unicode support and tab completion
a019c62
1. This reduces the number of write operations used during tab
   completion.
2. The tab completion calculated the string width using the length
   of the string instead of using the actual width. That is fixed.
3. The key decoder is now capable of handling characters composed
   out of two code points. That reduces the number of "keypress"
   events that are emitted which again lowers the amount of writes
   triggered.
@BridgeAR
BridgeAR force-pushed the 2020-01-09-readline-improvements branch from 2e65b26 to a019c62 Compare January 10, 2020 08:18
@BridgeAR
repl,readline: code cleanup
23c754f
This simplifies code that was more complicated than it had to be
and removes code that should never be reached.
@BridgeAR
BridgeAR force-pushed the 2020-01-09-readline-improvements branch from 9211679 to 23c754f Compare January 10, 2020 17:46
@BridgeAR BridgeAR changed the title readline: improve unicode support and tab completion repl,readline: improve unicode support and tab completion Jan 10, 2020
@BridgeAR
BridgeAR requested a review from jasnell January 10, 2020 17:48
@BridgeAR

BridgeAR commented Jan 10, 2020

Copy link
Copy Markdown
Member Author

@jasnell I pushed another commit that cleans up some code. It would have conflicted with the former commit if I would have opened another PR for it instead. PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jan 10, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/28353/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BridgeAR
BridgeAR commented Jan 10, 2020
View reviewed changes
Comment thread lib/readline.js
getStringWidth(this.line[this.cursor]) > 1) {
rows++;
cols = 0;
}

@BridgeAR BridgeAR Jan 10, 2020

Copy link
Copy Markdown
Member Author

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.

Our cursor can't be between two code points. We move the cursor by the correct length since a while.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@BridgeAR BridgeAR mentioned this pull request Jan 11, 2020
repl: prevent previews during pasting #31315
Closed
4 tasks done
@nodejs-github-bot

nodejs-github-bot commented Jan 11, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/28363/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott approved these changes Jan 11, 2020
View reviewed changes

@Trott Trott left a comment

Copy link
Copy Markdown
Member

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.

LGTM but I'm going to kick off a CITGM just to make sure the readline changes aren't breaking in an unexpected way.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Trott

Trott commented Jan 11, 2020

Copy link
Copy Markdown
Member

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2218/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 11, 2020
@nodejs-github-bot

nodejs-github-bot commented Jan 11, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/28365/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jan 11, 2020

Copy link
Copy Markdown
Member

Landed in a523283...fe05818

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Jan 11, 2020
Trott pushed a commit that referenced this pull request Jan 11, 2020
@BridgeAR @Trott
readline: improve unicode support and tab completion
5baae14
1. This reduces the number of write operations used during tab
   completion.
2. The tab completion calculated the string width using the length
   of the string instead of using the actual width. That is fixed.
3. The key decoder is now capable of handling characters composed
   out of two code points. That reduces the number of "keypress"
   events that are emitted which again lowers the amount of writes
   triggered.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Trott pushed a commit that referenced this pull request Jan 11, 2020
@BridgeAR @Trott
repl,readline: clean up code
fe05818
This simplifies code that was more complicated than it had to be
and removes code that should never be reached.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
@BridgeAR @MylesBorins
readline: improve unicode support and tab completion
3881189
1. This reduces the number of write operations used during tab
   completion.
2. The tab completion calculated the string width using the length
   of the string instead of using the actual width. That is fixed.
3. The key decoder is now capable of handling characters composed
   out of two code points. That reduces the number of "keypress"
   events that are emitted which again lowers the amount of writes
   triggered.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
@BridgeAR @MylesBorins
repl,readline: clean up code
f8e8059
This simplifies code that was more complicated than it had to be
and removes code that should never be reached.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Jan 16, 2020
v13.7.0 proposal #31382
Merged
@codebytere

codebytere commented Mar 14, 2020

Copy link
Copy Markdown
Member

@BridgeAR should this go back to v12.x? I'll add the label but feel free to swap out.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codebytere codebytere added the backport-requested-v12.x label Mar 14, 2020
@targos targos removed author ready PRs with CI started, the required approvals, and no outstanding review comments. backport-requested-v12.x labels Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
@BridgeAR @targos
readline: improve unicode support and tab completion
d1ea9e1
1. This reduces the number of write operations used during tab
   completion.
2. The tab completion calculated the string width using the length
   of the string instead of using the actual width. That is fixed.
3. The key decoder is now capable of handling characters composed
   out of two code points. That reduces the number of "keypress"
   events that are emitted which again lowers the amount of writes
   triggered.

PR-URL: nodejs#31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
@BridgeAR @targos
repl,readline: clean up code
3eb21f9
This simplifies code that was more complicated than it had to be
and removes code that should never be reached.

PR-URL: nodejs#31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
@BridgeAR @targos
readline: improve unicode support and tab completion
7582bce
1. This reduces the number of write operations used during tab
   completion.
2. The tab completion calculated the string width using the length
   of the string instead of using the actual width. That is fixed.
3. The key decoder is now capable of handling characters composed
   out of two code points. That reduces the number of "keypress"
   events that are emitted which again lowers the amount of writes
   triggered.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
@BridgeAR @targos
repl,readline: clean up code
f588301
This simplifies code that was more complicated than it had to be
and removes code that should never be reached.

PR-URL: #31288
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@targos targos mentioned this pull request May 2, 2020
v12.17.0 release proposal #33197
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Trott Trott Trott approved these changes
@jasnell jasnell Awaiting requested review from jasnell

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

readline Issues and PRs related to the built-in readline module. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@BridgeAR @nodejs-github-bot @Trott @codebytere @jasnell @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.