Skip to content

repl: handle dot commands in multiline input#63889

Open
Diyoncrz18 wants to merge 1 commit into
nodejs:mainfrom
Diyoncrz18:fix-repl-dot-commands-multiline-63864
Open

repl: handle dot commands in multiline input#63889
Diyoncrz18 wants to merge 1 commit into
nodejs:mainfrom
Diyoncrz18:fix-repl-dot-commands-multiline-63864

Conversation

@Diyoncrz18

Copy link
Copy Markdown

Fixes: #63864

This restores REPL dot-command handling when a command is entered from a TTY multiline continuation prompt.

Since TTY multiline input can arrive as one editable buffer like function a() {\n.break, the previous command detection only checked the beginning of the full buffer and sent .break, .help, and .exit to JavaScript evaluation, producing Uncaught SyntaxError: Unexpected token '.'.

This change checks the newest physical line for registered REPL dot-commands in the TTY multiline case, keeps the preceding lines in the existing buffered-command path, and dispatches the dot-command through the existing REPL keyword handling.

Added regression coverage for:

  • .break after a recoverable multiline input
  • .help after a recoverable multiline input
  • .exit after a recoverable multiline input

Validation:

  • node --check lib/repl.js
  • node --check test/parallel/test-repl-multiline.js
  • git diff --check

Note: I could not run python tools/test.py test/parallel/test-repl-multiline.js locally because this Windows checkout does not currently have a built Node binary.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL: dot-commands produce SyntaxError inside multi-line input

2 participants