]> khamidou — GitHub mirrors - electron.git/commitdiff
Go back to using node's console.* and std*.write
authorEran Tiktin <eran.t@mce-sys.com>
Sat, 10 Oct 2015 17:17:08 +0000 (20:17 +0300)
committerEran Tiktin <eran.t@mce-sys.com>
Sat, 10 Oct 2015 17:17:08 +0000 (20:17 +0300)
It seems that whatever issues we had with using the original
implementation of node for `console.*` calls and for
`process.std*.write` on Windows were solved.
So I removed the patch.

Tested it with cmd, cygwin and used spawn and exec and everything seems
to work (except for colors/ansi escape codes, but that didn't work
before anyway).

atom/browser/lib/init.coffee

index 9f92d700c73a192b615f1ee9bd2f7cb3226cbceb..67630a1bd6facfdfc6244c967dce7a80c09ee9db 100644 (file)
@@ -18,25 +18,6 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
 globalPaths = Module.globalPaths
 globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
 
-if process.platform is 'win32'
-  # Redirect node's console to use our own implementations, since node can not
-  # handle console output when running as GUI program.
-  consoleLog = (args...) ->
-    process.log util.format(args...) + "\n"
-  streamWrite = (chunk, encoding, callback) ->
-    chunk = chunk.toString(encoding) if Buffer.isBuffer chunk
-    process.log chunk
-    callback() if callback
-    true
-  console.log = console.error = console.warn = consoleLog
-  process.stdout.write = process.stderr.write = streamWrite
-
-  # Always returns EOF for stdin stream.
-  Readable = require('stream').Readable
-  stdin = new Readable
-  stdin.push null
-  process.__defineGetter__ 'stdin', -> stdin
-
 # Don't quit on fatal error.
 process.on 'uncaughtException', (error) ->
   # Do nothing if the user has a custom uncaught exception handler.