nodejs / nodejs/node

readline.line automatically escapes input

Open
#45,950 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

readline
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

Version

18.12.0

Platform

Microsoft Windows NT 10.0.22621.0 x64

Subsystem

readline

What steps will reproduce the bug?

Use readline and access its line variable.

rl.line

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

I see that if I input \n, then it is automatically escaped with \\n, is it possible to disable this behavior and get \n?

Additional information

I am not sure if this behavior is something wanted. If so, then I am asking if there is an alternative to get the non-escaped character. (\n)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with Node.js 18.12.0 on Windows by using readline and inspecting rl.line after entering the reported input. Clarify whether the input represents a literal backslash sequence or a newline, then determine the intended behavior; completion requires a confirmed expectation and a regression test or documented alternative in the readline subsystem.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.