You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constconcurrently=require('concurrently')concurrently(['echo hi && sleep 100',],{inputStream: process.stdin,}).catch(console.error)
yarn node start.js
With yarn 1
Doing Ctrl+C on the yarn node start.js command will exit, but then hitting Enter again will show an error when NodeJS tries to read the line after exiting:
events.js:291
throw er; // Unhandled 'error' event
^
Error: read EIO
at TTY.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -5,
code: 'EIO',
syscall: 'read'
}
With yarn 2
Run yarn set version berry before running yarn node start.js again. This time, when doing Ctrl+C, the script will hang until you do Ctrl+D
With node
Running just node start.js has the same behavior as yarn 2
Resolution
There's probably some code in concurrently that needs to stop listening to inputStream when the process exits. That should solve the problems with both yarn 1 and 2
Workaround
Manually destroying process.stdin after the process exits seems to fix
Using yarn versions 1.22.10 and 2.4.0
Repro
yarn add concurrently
yarn node start.js
With yarn 1
Doing Ctrl+C on the
yarn node start.js
command will exit, but then hitting Enter again will show an error when NodeJS tries to read the line after exiting:With yarn 2
Run
yarn set version berry
before runningyarn node start.js
again. This time, when doing Ctrl+C, the script will hang until you do Ctrl+DWith node
Running just
node start.js
has the same behavior as yarn 2Resolution
There's probably some code in
concurrently
that needs to stop listening toinputStream
when the process exits. That should solve the problems with both yarn 1 and 2Workaround
Manually destroying
process.stdin
after the process exits seems to fixThe text was updated successfully, but these errors were encountered: