Skip to content

Commit

Permalink
Close readline w/o changing stdin's pause state
Browse files Browse the repository at this point in the history
  • Loading branch information
clavin committed Jun 24, 2022
1 parent c2400db commit ad5e9b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utilities.js
Expand Up @@ -79,7 +79,17 @@ export class StdinDiscarder {
return;
}

const {stdin} = process;
const wasPaused = stdin.isPaused();

this.#rl.close();

// Keep stdin unpaused across the readline close if it is already
// unpaused. See #209 for more details.
if (!wasPaused && stdin.isPaused()) {
stdin.resume();
}

this.#rl = undefined;
}
}

0 comments on commit ad5e9b3

Please sign in to comment.