Skip to content

fix: add support for wrapped line syntax highlighting and terminal resizing in the REPL output stream - #14701

Merged
kgryte merged 2 commits into
stdlib-js:developfrom
0PrashantYadav0:bug/repl
Aug 27, 2026
Merged

kgryte merged 2 commits into
stdlib-js:developfrom
0PrashantYadav0:bug/repl

Conversation

@0PrashantYadav0

Copy link
Copy Markdown
Member

type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown_pkg_readmes status: na
  • task: lint_markdown_docs status: na
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed ---

Resolves #14646

Description

What is the purpose of this pull request?

This pull request:

  • add support for wrapped line syntax highlighting and terminal resizing in the REPL output stream

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".


@stdlib-js/reviewers

…esizing in the REPL output stream

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@0PrashantYadav0
0PrashantYadav0 requested a review from a team August 27, 2026 07:36
@0PrashantYadav0 0PrashantYadav0 added Bug Something isn't working. REPL Issue or pull request specific to the project REPL. labels Aug 27, 2026
@0PrashantYadav0 0PrashantYadav0 changed the title feat: add support for wrapped line syntax highlighting and terminal resizing in the REPL output stream fix: add support for wrapped line syntax highlighting and terminal resizing in the REPL output stream Aug 27, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 27, 2026
* @memberof OutputStream.prototype
* @type {(integer|void)}
*/
setNonEnumerableReadOnlyAccessor( OutputStream.prototype, 'columns', function columns() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are making this a public API, it needs to come after the _ prefixed methods/properties below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this property necessary? As best I can tell, you never use it anywhere.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I think I know what is going on. You need to override this property, I am guessing, as other consumers may assume the existence of a columns property?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's exactly it. The "other consumer" is Node's readline interface, which assumes its output stream exposes columns. Since OutputStream sits in front of the TTY, it must define columns to forward the viewport width; that's also why it has to keep the exact name columns rather than a _‑prefixed one.

@kgryte

kgryte commented Aug 27, 2026

Copy link
Copy Markdown
Member

Based on CI, looks like you've broken syntax highlighting.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Aug 27, 2026
…ting test to account for cursor repositioning

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
repl $\\color{red}18617/25192$
$\\color{green}+73.90\\%$
$\\color{red}887/1160$
$\\color{green}+76.47\\%$
$\\color{red}217/460$
$\\color{green}+47.17\\%$
$\\color{red}18617/25192$
$\\color{green}+73.90\\%$

The above coverage report was generated for the changes in this PR.

@0PrashantYadav0
0PrashantYadav0 requested a review from kgryte August 27, 2026 09:26
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 27, 2026
@0PrashantYadav0 0PrashantYadav0 removed the Needs Changes Pull request which needs changes before being merged. label Aug 27, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything off, but hard to say without actually using the REPL. So, let's go ahead and merge, and we can address any further issues in follow-up PRs.

@kgryte
kgryte merged commit 7fc2896 into stdlib-js:develop Aug 27, 2026
29 checks passed
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working. REPL Issue or pull request specific to the project REPL.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: REPL rendering goes awry when entering a command exceeding the terminal width

3 participants