Skip to content

Correctly redirect output to console on Windows - #5776

Merged
zcbenz merged 2 commits into
masterfrom
fix-node-output
May 31, 2016
Merged

zcbenz merged 2 commits into
masterfrom
fix-node-output

Conversation

@zcbenz

@zcbenz zcbenz commented May 31, 2016

Copy link
Copy Markdown
Contributor

Since the upgrade to VS 2015, the implementation of stdio seems to have changed. This PR fixes routing stdio to Console by using base::RouteStdioToConsole.

However it is impossible to make stdin work, we have to attach to parent Console, but because Electron is a GUI program, Windows is not willing to pipe stdin to us. One workaround is to alloc a new Console window for Electron, which would cause troubles since it makes every Electron process being attached with an extra Console window.

This should be totally fine for all apps though, the only downside is we are not able to run REPL in Electron on Windows.

Close #5713.
Close #5715.

@zcbenz
zcbenz force-pushed the fix-node-output branch from 5456015 to 4d8994d Compare May 31, 2016 02:05
@bpasero

bpasero commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

@zcbenz Does this change make the ELECTRON_NO_ATTACH_CONSOLE workaround on Windows obsolete? We set it to get output together with ELECTRON_RUN_AS_NODE and now I wonder if we can remove the no-attach if we update to a newer Electron.

@zcbenz

zcbenz commented Jul 1, 2016

Copy link
Copy Markdown
Contributor Author

@bpasero I'm not sure, ideally the output of node processes should work out of box now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ELECTRON_RUN_AS_NODE not printing output to console on Windows [WINDOWS] spawn stdio not piping

2 participants