code: function openFile(file) {
        var edit;
        if (!editor || gui) {
          open(file);
        } else {
          edit = spawn(editor, [file], {stdio: 'inherit'});
          edit.on('exit', process.exit);
        }
      }
docs: spawn process and open with associated gui or terminal editor