Skip to content

readline: crlfDelay and fs streams #16077

@vsemozhetbyt

Description

@vsemozhetbyt
  • Version: from v6.6.0
  • Platform: mostly Windows
  • Subsystem: readline

Recently, I've got a complaint that some of my old scripts for a line by line processing of big files add unexpected new lines. The cause seems to be similar to the one described in this OP.

I suggest two variants of precaution:

  1. Add a small note to the doc + set crlfDelay to Infinity in our main file stream example. This change is milder, but it is also a bit confusing and makes the fs example look like a workaround or even an abuse of terminal API.

  2. Automatically set crlfDelay to Infinity when terminal is false or even completely remove this check from ._normalWrite(). Is there any reason for this option in fs use cases?

Refs: #8109, #13497

Metadata

Metadata

Assignees

No one assigned

    Labels

    readlineIssues and PRs related to the built-in readline module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions