2018-05-30 09:18:43 +00:00
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const child_process = require('child_process');
|
|
|
|
|
|
|
|
// Tests that exiting through normal means resets the TTY mode.
|
|
|
|
// Refs: https://github.com/nodejs/node/issues/21020
|
|
|
|
|
|
|
|
child_process.spawnSync(process.execPath, [
|
2021-03-26 15:51:08 +00:00
|
|
|
'-e', 'process.stdin.setRawMode(true)',
|
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);
|
|
|
|
}
|