Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Follow up: Readline proposal #2756

Closed
Closed
@Southern

Description

This is a follow up for #2737.

I have talked with @indutny, and we have agreed on the following as changes for the readline module.

Closing the input with this.input.destroy() would not be sufficient to solve the problem with the readline module hanging when it's closed. This is because returning a new interface from rl.resume() would cause users to have to reassign the interface. For example: var rl = rl.resume(); rl.prompt();, instead of rl.prompt() (where prompt would cause the stream to resume on its own).

We think it would be best to get rid of rl.close() altogether, and instead use only rl.pause() and rl.resume(). rl.pause() and rl.resume() will also emit a pause and resume event, in case users may want to trigger some functionality when the stream is paused or resumed.

This will not effect a user wanting to catch the SIGINT event when running readline, as readline already emits a SIGINT event if there is one present. If there is not a SIGINT event to be emitted, it then defaults to attempting to close the stream (which will be changed to a pause in the proposal).

Feedback, disagreements, or commentary welcome.

/cc: @isaacs @bnoordhuis

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions