@@ -118,9 +118,6 @@ var gUsingConditionOpts = false;
118
118
var pager = null ;
119
119
var stdout = process . stdout ;
120
120
121
- // Whether we are reading from stdin.
122
- var readingStdin = false ;
123
-
124
121
125
122
126
123
//---- support functions
@@ -1133,7 +1130,6 @@ function drainStdoutAndExit(code) {
1133
1130
* @param callback {Function} `function ()`
1134
1131
*/
1135
1132
function processStdin ( opts , stylize , callback ) {
1136
- readingStdin = true ;
1137
1133
var leftover = '' ; // Left-over partial line from last chunk.
1138
1134
var stdin = process . stdin ;
1139
1135
stdin . resume ( ) ;
@@ -1469,16 +1465,7 @@ function cleanupAndExit(code, signal) {
1469
1465
1470
1466
//---- mainline
1471
1467
1472
- process . on ( 'SIGINT' , function ( ) {
1473
- /**
1474
- * Ignore SIGINT (Ctrl+C) if processing stdin -- we should process
1475
- * remaining output from preceding process in the pipeline and
1476
- * except *it* to close.
1477
- */
1478
- if ( ! readingStdin ) {
1479
- cleanupAndExit ( 1 , 'SIGINT' ) ;
1480
- }
1481
- } ) ;
1468
+ process . on ( 'SIGINT' , function ( ) { cleanupAndExit ( 1 , 'SIGINT' ) ; } ) ;
1482
1469
process . on ( 'SIGQUIT' , function ( ) { cleanupAndExit ( 1 , 'SIGQUIT' ) ; } ) ;
1483
1470
process . on ( 'SIGTERM' , function ( ) { cleanupAndExit ( 1 , 'SIGTERM' ) ; } ) ;
1484
1471
process . on ( 'SIGHUP' , function ( ) { cleanupAndExit ( 1 , 'SIGHUP' ) ; } ) ;
0 commit comments