nodejs / nodejs/node

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

Offen
#53,923 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature request readline
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der Untersuchung der TTY-Eingabeverarbeitung von node:readline und wie nicht druckbare Zeichen derzeit behandelt werden. Der Issue schlägt entweder ein globales Flag, eine Allowlist oder beides vor, daher müsste ein Beitragender zunächst diese Designentscheidung klären. Als erledigt gilt die Aufgabe, wenn das Gruppentrennzeichen gelesen werden kann, ohne das bestehende readline-Verhalten zu beeinträchtigen, und eine Abdeckung für die gewählte Option vorhanden ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, nodejs
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.