MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / trapWindowsSignals

Function trapWindowsSignals

lib/utilities/will-interrupt-process.js:159–173  ·  view source on GitHub ↗

* Suppresses "Terminate batch job (Y/N)" confirmation on Windows * * @method trapWindowsSignals

(_process)

Source from the content-addressed store, hash-verified

157 * @method trapWindowsSignals
158 */
159function 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
175function cleanupWindowsSignals(_process) {
176 const stdin = _process.stdin;

Callers 1

setupSignalsTrapFunction · 0.85

Calls 2

emitMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…