-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: option for console #5197
Comments
@xylosper It would be more helpful to understand your request if you can provide usage scenarios in code. |
@xylosper you could always just use If you are using stdout for interprocess communication you'll want to write a wrapper anyways to have an identifiable format, since nwjs writes stuff to stdout too. |
@ghostoy const spawn = require('child_process').spawn;
const child = spawn('nw', ['path/to/child/process']);
child.stdout.on('data', data => {
const result = parseDataFromChildProcess(data);
const feedback = doSomethingWithResult(result);
child.stdin.write(makeAnFeedbackMessage(feedback);
}); For now, there's nothing retrieved from @kiavashps index.html <html>
<head>
<script>
console.log('console.log');
process.stdout.write('process.stdout.write');
</script>
</head>
<body></body>
</html> package.json {
"main": "index.html",
"name": "test"
} When I run this in terminal(windows cmd), I cannot get nothing in terminal and I can see only 'console.log' in console of devTools. |
@xylosper interesting, it works for me on mac 10.11 and nwjs v0.15.4 |
I can confirm this behavior on Windows 10 using NW.js 0.16.1. This 3 year old issue seems related: #685 |
@kiavashps @frankhale |
yeah, in my experience stdout doesn't work on Windows (while it works fine on other OSes). Only stderr works. Which is problematic for some loggings libraries (including https://github.com/visionmedia/debug) |
nw redirects console to devtool.
This behavior disables simple inter-process communication through stdout.
An option for console would be really helpful to choice behaviour.
I think 'enable redirection/disable redirection/use both of redirection and terminal output' would be fine.
As advanced requests, integration with process.stdout would be more helpful and if stdin implemented, it will be really great!
The text was updated successfully, but these errors were encountered: