bug fix
This commit is contained in:
@@ -227,6 +227,9 @@ export default class App extends PureComponent<Props, State> {
|
|||||||
// The buffered text is preserved for REPL.tsx via consumeEarlyInput().
|
// The buffered text is preserved for REPL.tsx via consumeEarlyInput().
|
||||||
stopCapturingEarlyInput();
|
stopCapturingEarlyInput();
|
||||||
stdin.ref();
|
stdin.ref();
|
||||||
|
// Windows consoles can leave stdin paused even after raw mode is set.
|
||||||
|
// Explicitly resuming keeps `readable` events flowing cross-platform.
|
||||||
|
stdin.resume();
|
||||||
stdin.setRawMode(true);
|
stdin.setRawMode(true);
|
||||||
stdin.addListener('readable', this.handleReadable);
|
stdin.addListener('readable', this.handleReadable);
|
||||||
// Enable bracketed paste mode
|
// Enable bracketed paste mode
|
||||||
@@ -275,6 +278,7 @@ export default class App extends PureComponent<Props, State> {
|
|||||||
this.props.stdout.write(DBP);
|
this.props.stdout.write(DBP);
|
||||||
stdin.setRawMode(false);
|
stdin.setRawMode(false);
|
||||||
stdin.removeListener('readable', this.handleReadable);
|
stdin.removeListener('readable', this.handleReadable);
|
||||||
|
stdin.pause();
|
||||||
stdin.unref();
|
stdin.unref();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export function startCapturingEarlyInput(): void {
|
|||||||
process.stdin.setEncoding('utf8')
|
process.stdin.setEncoding('utf8')
|
||||||
process.stdin.setRawMode(true)
|
process.stdin.setRawMode(true)
|
||||||
process.stdin.ref()
|
process.stdin.ref()
|
||||||
|
process.stdin.resume()
|
||||||
|
|
||||||
readableHandler = () => {
|
readableHandler = () => {
|
||||||
let chunk = process.stdin.read()
|
let chunk = process.stdin.read()
|
||||||
|
|||||||
Reference in New Issue
Block a user