* Suppresses "Terminate batch job (Y/N)" confirmation on Windows * * @method trapWindowsSignals
(_process)
| 157 | * @method trapWindowsSignals |
| 158 | */ |
| 159 | function trapWindowsSignals(_process) { |
| 160 | const stdin = _process.stdin; |
| 161 | |
| 162 | originalIsRaw = stdin.isRaw; |
| 163 | |
| 164 | // This is required to capture Ctrl + C on Windows |
| 165 | stdin.setRawMode(true); |
| 166 | |
| 167 | windowsCtrlCTrap = function (data) { |
| 168 | if (data.length === 1 && data[0] === 0x03) { |
| 169 | _process.emit('SIGINT'); |
| 170 | } |
| 171 | }; |
| 172 | stdin.on('data', windowsCtrlCTrap); |
| 173 | } |
| 174 | |
| 175 | function cleanupWindowsSignals(_process) { |
| 176 | const stdin = _process.stdin; |
no test coverage detected
searching dependent graphs…