Skip to content

Commit

Permalink
Corrected signal handling inside Docker containers
Browse files Browse the repository at this point in the history
This closes #192 and fixes #159
  • Loading branch information
leo committed Jun 20, 2017
1 parent 25fa53c commit 604f335
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/listening.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ module.exports = coroutine(function*(server, current, inUse, clipboard, open) {
const details = server.address()
const isTTY = process.stdout.isTTY

process.on('SIGINT', () => {
const shutdown = () => {
server.close()

// eslint-disable-next-line unicorn/no-process-exit
process.exit(0)
})
}

process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)

let isDir

Expand Down

0 comments on commit 604f335

Please sign in to comment.