2018-05-30 09:18:43 +00:00
|
|
|
'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, [
|
2021-03-26 15:51:08 +00:00
|
|
|
'-e', 'process.stdin.setRawMode(true); process.exit(0)',
|
2018-05-30 09:18:43 +00:00
|
|
|
], { stdio: 'inherit' });
|
|
|
|
|
|
|
|
const { stdout } = child_process.spawnSync('stty', {
|
|
|
|
stdio: ['inherit', 'pipe', 'inherit'],
|
2023-01-29 18:14:30 +00:00
|
|
|
encoding: 'utf8',
|
2018-05-30 09:18:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
if (stdout.match(/-echo\b/)) {
|
|
|
|
console.log(stdout);
|
|
|
|
}
|