File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1643,12 +1643,17 @@ const parentSigtermCallback: SigtermCallback = async (signal, exitCode) => {
16431643 await Promise . all ( [ ...sigtermCallbacks ] . map ( ( cb ) => cb ( signal , exitCode ) ) )
16441644}
16451645
1646+ const drain = ( ) => { }
1647+
16461648export const setupSIGTERMListener = (
16471649 callback : ( signal ?: 'SIGTERM' , exitCode ?: number ) => Promise < void > ,
16481650) : void => {
16491651 if ( sigtermCallbacks . size === 0 ) {
16501652 process . once ( 'SIGTERM' , parentSigtermCallback )
16511653 if ( process . env . CI !== 'true' ) {
1654+ if ( ! process . stdin . isTTY ) {
1655+ process . stdin . on ( 'data' , drain )
1656+ }
16521657 process . stdin . on ( 'end' , parentSigtermCallback )
16531658 }
16541659 }
@@ -1662,6 +1667,7 @@ export const teardownSIGTERMListener = (
16621667 if ( sigtermCallbacks . size === 0 ) {
16631668 process . off ( 'SIGTERM' , parentSigtermCallback )
16641669 if ( process . env . CI !== 'true' ) {
1670+ process . stdin . off ( 'data' , drain )
16651671 process . stdin . off ( 'end' , parentSigtermCallback )
16661672 }
16671673 }
You can’t perform that action at this time.
0 commit comments