{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/8807","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/8807/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8807/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/8807/events","html_url":"https://github.com/nodejs/node/issues/8807","id":179541406,"number":8807,"title":"Can not getting complete stdout","user":{"login":"naumanumer","id":19629102,"avatar_url":"https://avatars.githubusercontent.com/u/19629102?v=3","gravatar_id":"","url":"https://api.github.com/users/naumanumer","html_url":"https://github.com/naumanumer","followers_url":"https://api.github.com/users/naumanumer/followers","following_url":"https://api.github.com/users/naumanumer/following{/other_user}","gists_url":"https://api.github.com/users/naumanumer/gists{/gist_id}","starred_url":"https://api.github.com/users/naumanumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naumanumer/subscriptions","organizations_url":"https://api.github.com/users/naumanumer/orgs","repos_url":"https://api.github.com/users/naumanumer/repos","events_url":"https://api.github.com/users/naumanumer/events{/privacy}","received_events_url":"https://api.github.com/users/naumanumer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/child_process","name":"child_process","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-27T16:18:07Z","updated_at":"2016-09-30T19:54:19Z","closed_at":null,"body":"Version: v4.4.7\r\nPlatform: windows 10 (64 bit)\r\n\r\n``` javascript\r\nconst spawn = require('child_process').spawn;\r\n  const ls = spawn(\"D:\\\\Documents\\\\Nauman Umer\\\\New folder\\\\electron-quick-start\\\\PC-BASIC\\\\a.bat\", []);\r\n\r\n  ls.stdout.on('data', (data) => {\r\n    console.log(`stdout: ${data}`);\r\n  });\r\n\r\n  ls.stderr.on('data', (data) => {\r\n    console.log(`stderr: ${data}`);\r\n  });\r\n\r\n  ls.on('close', (code) => {\r\n    console.log(`child process exited with code ${code}`);\r\n  });\r\n```\r\n**a.bat**\r\n``` batch\r\n\"D:\\Documents\\Nauman Umer\\New folder\\electron-quick-start\\PC-BASIC\\pcbasic.com\" --load=\"art.bas\" --convert=A\r\n```\r\n\r\nits ouput when executed from command line:\r\n```\r\n\r\nD:\\Documents\\Nauman Umer\\New folder\\electron-quick-start\\PC-BASIC>\"D:\\Documents\\Nauman Umer\\New folder\\electron-quick-start\\PC-BASIC\\pcbasic.com\" --load=\"art.bas\" --convert=A\r\n940 REM The IBM Personal Computer Art\r\n950 REM Version 1.10 (C)Copyright IBM Corp 1981, 1982\r\n960 REM Licensed Material - Program Property of IBM\r\n970 REM Author - Glenn Stuart Dardick\r\n975 DEF SEG:  POKE 106,0\r\n980 SAMPLES$ = \"NO\"\r\n990 GOTO 1010\r\n[AND SO ON]\r\n```\r\npcbasic is written in python and using `sys.stdout.write()` instead of `print`.\r\n\r\nbut when I run this bat file with from my electron app using to about javascript code it results \r\n```\r\nstdout:\r\nD:\\Documents\\Nauman Umer\\New folder\\electron-quick-start>\"D:\\Documents\\Nauman Umer\\New folder\\electron-quick-start\\PC-BASIC\\pcbasic.com\" --load=\"art.bas\" --convert=A\r\n[PROGRAM OUTPUT MISSING]\r\nchild process exited with code 0\r\n```\r\n\r\nI also tried `spawn`, `exec` and `execFile` but getting same issue. and i also tried to execute pcbasic directly from program instead of from batch file but getting same problem. when i tried to redirect pcbasic output to file i noticed that a file is created but it is empty.\r\nI tried following to redirect:\r\n* in bat file\r\n```batch\r\n\"D:\\Documents\\Nauman Umer\\New folder\\electron-quick-start\\PC-BASIC\\pcbasic.com\" --load=\"art.bas\" --convert=A > a.txt\r\n```\r\n* in electron app\r\n``` javascript\r\nspawn(`\"D:\\\\Documents\\\\Nauman Umer\\\\New folder\\\\electron-quick-start\\\\PC-BASIC\\\\a.bat\" > a.bat`, []);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/250837179","html_url":"https://github.com/nodejs/node/issues/8807#issuecomment-250837179","issue_url":"https://api.github.com/repos/nodejs/node/issues/8807","id":250837179,"user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T19:54:19Z","updated_at":"2016-09-30T19:54:19Z","body":"Are either of you calling `process.exit()` in your code or does a dependency call it?"}}
{"actor":{"display_login":"Fishrock123"}}