SIGTSTP event (Readline)

Event: 'SIGTSTP'

function () {}

This does not work on Windows.

Emitted whenever the input stream receives a ^Z, respectively known as SIGTSTP. If there is no SIGTSTP event listener present when the input stream receives a SIGTSTP, the program will be sent to the background.

When the program is resumed with fg, the 'pause' and SIGCONT events will be emitted. You can use either to resume the stream.

The 'pause' and SIGCONT events will not be triggered if the stream was paused before the program was sent to the background.

Example of listening for SIGTSTP:

rl.on('SIGTSTP', () => {
  // This will override SIGTSTP and prevent the program from going to the
  // background.
  console.log('Caught SIGTSTP.');
});
doc_Nodejs
2016-04-30 04:42:20
Comments
Leave a Comment

Please login to continue.