Skip to content

SIGINT for Windows (?) #4

Description

@toschug

I am on Windows here, and rewind refused to restart.

For example see this console output:

C:\Code\nodejs\workspace\test>rewind server.js
Connected.

+ `C:\Code\nodejs\workspace\test\routes\about.js` changed, restarting server.js
+ waiting for server.js to terminate...
internal/child_process.js:374
      throw errnoException(err, 'kill');
      ^

Error: kill ENOSYS
    at exports._errnoException (util.js:870:11)
    at ChildProcess.kill (internal/child_process.js:374:13)
    at Monitor.spawn (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\monitor.js:124:14)
    at Monitor.restart (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\monitor.js:114:14)
    at Monitor.changed (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\monitor.js:109:14)
    at Watcher.<anonymous> (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\monitor.js:56:9)
    at emitTwo (events.js:87:13)
    at Watcher.emit (events.js:172:7)
    at Watcher.changed (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\watcher.js:130:8)
    at FSWatcher.<anonymous> (C:\Users\default.CORSAIR\AppData\Roaming\npm\node_modules\rewind\lib\watcher.js:114:9)

I found this, which may be related: balderdashy/sails#846

So I changed SIGHUP to SIGINT in monitor.js:

  • around line 120: signal = signal || 'SIGINT';
  • around line 141: if (signal === 'SIGINT') {

Then it worked for me.
There is probably a much better approach to fix this.
Not sure about details involved or if this breaks things for other OSes etc.
Just a quick hint.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions