1'use strict'; 2require('../common'); 3const child_process = require('child_process'); 4 5// Tests that exiting through normal means resets the TTY mode. 6// Refs: https://github.com/nodejs/node/issues/21020 7 8child_process.spawnSync(process.execPath, [ 9 '-e', 'process.stdin.setRawMode(true)', 10], { stdio: 'inherit' }); 11 12const { stdout } = child_process.spawnSync('stty', { 13 stdio: ['inherit', 'pipe', 'inherit'], 14 encoding: 'utf8' 15}); 16 17if (stdout.match(/-echo\b/)) { 18 console.log(stdout); 19} 20