diff options
Diffstat (limited to 'deps/npm/node_modules/editor/index.js')
-rw-r--r-- | deps/npm/node_modules/editor/index.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/deps/npm/node_modules/editor/index.js b/deps/npm/node_modules/editor/index.js index 8f1a3ebefb..3774edbe37 100644 --- a/deps/npm/node_modules/editor/index.js +++ b/deps/npm/node_modules/editor/index.js @@ -9,18 +9,12 @@ module.exports = function (file, opts, cb) { var ed = /^win/.test(process.platform) ? 'notepad' : 'vim'; var editor = opts.editor || process.env.VISUAL || process.env.EDITOR || ed; + var args = editor.split(/\s+/); + var bin = args.shift(); - setRaw(true); - var ps = spawn(editor, [ file ], { customFds : [ 0, 1, 2 ] }); + var ps = spawn(bin, args.concat([ file ]), { stdio: 'inherit' }); ps.on('exit', function (code, sig) { - setRaw(false); - process.stdin.pause(); if (typeof cb === 'function') cb(code, sig) }); }; - -var tty = require('tty'); -function setRaw (mode) { - process.stdin.setRawMode ? process.stdin.setRawMode(mode) : tty.setRawMode(mode); -} |