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