nodejs / nodejs/node

node:readline support reading non printable characters such as group separator

Open
#53,923 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What is the problem this feature will solve?

When using a USB barcode reader on a TTY app that uses node:readline the group separator character \x1d is needed for GS1-128 barcodes. GS1-128 barcodes contain multiple elements defined by an Application Identifier (AI) that is a 2-4 digit code followed by value. Either a defined length is expected for the data or it looks for the group separator character for early termination of the value.

What is the feature you are proposing to solve the problem?

accept some or all non printable characters as inputs to readline

One of the following

  1. add a flag to turn on that by default is disable to preserve existing implementations
  2. add an option to explicitly define allowable non printable characters, defaults to an empty list
  3. both a global flag and a list
What alternatives have you considered?

I've considered writing my own, seems like a bad idea for support and security. I may look into putting in a PR but I'm starting with a feature request.
I've considered rewriting the application into a non NodeJS application.
I've considered just replacing the TTY app with something more "modern" but there are external layers affecting this decision. This wouldn't allow copy/pasta of other characters which could be useful in some edge cases.

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

Start by examining node:readline's TTY input handling and how it currently treats non-printable characters. The issue proposes either a global flag, an allowlist, or both, so a contributor would first need to resolve that design choice. Done means the group separator can be read without breaking existing readline behavior, with coverage for the chosen option.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.