-
-
Notifications
You must be signed in to change notification settings - Fork 68
Ctrl+C not working #68
Comments
Can't reproduce. Are you sure it's |
I found the issue. Most tasks in grunt are synchronous. In our case our default task is a big synchronous task which does a lot of sync file IO ( This can be seen with this simple Gruntfile: module.exports = function(grunt) {
require('time-grunt')(grunt);
grunt.registerTask('default', function() {
console.log('testing...');
var end = Date.now() + 4000;
while (Date.now() < end) {
grunt.file.write('test', 'test');
}
console.log('done');
});
}; Try killing it with Ctrl+C and you'll see it only gets killed after the task completes. Now remove So in conclusion: because most grunt tasks are written in a synchronous way there is nothing |
I would suggest removing Lines 147 to 149 in d850113
For now the workaround we're using is: var processOn = process.on;
process.on = function(what,cb) {if(what!=='SIGINT'){processOn.call(process,what,cb);}};
require('time-grunt')(grunt);
process.on = processOn; |
Closing as this project is deprecated because Grunt is no longer actively maintained, so it doesn't make sense for me to maintain this project either. |
When using time-grunt you can't Ctrl+C to kill grunt anymore. It just continues and ignores the event completely and exits when it's done.
The text was updated successfully, but these errors were encountered: