Skip to content

Commit

Permalink
Added clear screen support. See #37
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnass committed Jul 20, 2012
1 parent f61796e commit 85f06cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -39,6 +39,11 @@ This will install `node-dev` and make it globally available (note the `-g` optio

In order to use Growl notifications [growlnotify](http://growl.info/extras.php#growlnotify) must be installed on your system.

Settings
========

You can set the `NODE_DEV_CLEARSCREEN` environment variable to `true` if in order to automatically clear the terminal screen upon restarts.


Contributors
============
Expand Down
2 changes: 2 additions & 0 deletions wrapper.js
Expand Up @@ -6,6 +6,7 @@ var fs = require('fs');
var Path = require('path');
var vm = require('vm');
var spawn = require('child_process').spawn;
var clearScreen = /true|yes|on|1/i.test(process.env.NODE_DEV_CLEARSCREEN);

/** Remove wrapper.js from the argv array */
process.argv.splice(1, 1);
Expand Down Expand Up @@ -62,6 +63,7 @@ function checkExitCode(code) {
*/
function watch(file) {
watchFile(file, function() {
if (clearScreen) process.stdout.write('\033[2J\033[H');
notify('Restarting', file + ' has been modified');
triggerRestart();
});
Expand Down

0 comments on commit 85f06cf

Please sign in to comment.