mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
7c8eec0648
Before PR 20592, closing all handles associated with the main event loop would also mean that `uv_tty_reset_mode()` can’t function properly because the corresponding FDs have already been closed. Add regression tests for this condition. Refs: https://github.com/nodejs/node/issues/21020 Refs: https://github.com/nodejs/node/pull/20592 PR-URL: https://github.com/nodejs/node/pull/21027 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
455 B
JavaScript
19 lines
455 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const child_process = require('child_process');
|
|
|
|
// Tests that exiting through process.exit() resets the TTY mode.
|
|
|
|
child_process.spawnSync(process.execPath, [
|
|
'-e', 'process.stdin.setRawMode(true); process.exit(0)'
|
|
], { stdio: 'inherit' });
|
|
|
|
const { stdout } = child_process.spawnSync('stty', {
|
|
stdio: ['inherit', 'pipe', 'inherit'],
|
|
encoding: 'utf8'
|
|
});
|
|
|
|
if (stdout.match(/-echo\b/)) {
|
|
console.log(stdout);
|
|
}
|