Skip to content

Commit

Permalink
fix(init): clean the terminal if killed
Browse files Browse the repository at this point in the history
Before, when user terminates `karma init` during answering a question, the terminal would stay colored.
  • Loading branch information
vojtajina committed Dec 7, 2013
1 parent 0a6a0ee commit e2aa749
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/init.js
Expand Up @@ -349,6 +349,12 @@ exports.init = function(config) {

rli.on('line', sm.onLine.bind(sm));

// clean colors
rli.on('SIGINT', function() {
rli.write(colors.END + '\n');
process.exit(0);
});

sm.process(questions, function(answers) {
var cwd = process.cwd();
var configFile = config.configFile || 'karma.conf.js';
Expand Down

0 comments on commit e2aa749

Please sign in to comment.