-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Customizable subprompt in node:repl module #59401
Copy link
Copy link
Closed as not planned
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Type
Projects
- StatusShow more project fieldsAwaiting Triage
What is the problem this feature will solve?
#57400 changed the
node:replmodule's "subprompt" from...to|. This is arguably good for Node's REPL where the main prompt is one character (>), so it encourages alignment, but bad for other software that relied on the subprompt being 3 characters long. See e.g. DanielXMoore/Civet#1768What is the feature you are proposing to solve the problem?
I suggest that
subpromptcan be specified in theoptionsobject tonode:repl, which lets the subprompt be configured. The default remains"| ".This will require changing the structure of
node:readline(where this subprompt is currently stored), though I'm not sure whether we need a public API there.What alternatives have you considered?
FWIW, #57400 that changed from
...to|mentionedTODO(puskin94): make this configurable(though the comment has since been removed).I also tried manually overriding
require('node:repl').Interface.prototype.setPromptandrequire('node:repl').Interface.prototype.prompt, but this did not seem to work; perhaps a different copy ofInterfaceis getting used bynode:repl.