{"action":"created","issue":{"url":"https://api.github.com/repos/ninja-build/ninja/issues/1010","labels_url":"https://api.github.com/repos/ninja-build/ninja/issues/1010/labels{/name}","comments_url":"https://api.github.com/repos/ninja-build/ninja/issues/1010/comments","events_url":"https://api.github.com/repos/ninja-build/ninja/issues/1010/events","html_url":"https://github.com/ninja-build/ninja/issues/1010","id":103788656,"number":1010,"title":"Ninja output into dumb terminal is not machine parsable","user":{"login":"colincross","id":2066996,"avatar_url":"https://avatars.githubusercontent.com/u/2066996?v=3","gravatar_id":"","url":"https://api.github.com/users/colincross","html_url":"https://github.com/colincross","followers_url":"https://api.github.com/users/colincross/followers","following_url":"https://api.github.com/users/colincross/following{/other_user}","gists_url":"https://api.github.com/users/colincross/gists{/gist_id}","starred_url":"https://api.github.com/users/colincross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colincross/subscriptions","organizations_url":"https://api.github.com/users/colincross/orgs","repos_url":"https://api.github.com/users/colincross/repos","events_url":"https://api.github.com/users/colincross/events{/privacy}","received_events_url":"https://api.github.com/users/colincross/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-28T20:15:49Z","updated_at":"2015-11-12T01:18:40Z","closed_at":null,"body":"When ninja writes to a smart terminal it writes the status line for each edge when the command starts and then again when the command finishes immediately followed by the command output.  When writing to a dumb terminal it only writes the status line when the command starts, to avoid duplicate status lines in the output.  When building in parallel the dumb output ends up looking like:\r\nstatus for cmd 1\r\nstatus for cmd 2\r\noutput for cmd 1\r\noutput for cmd 2\r\n\r\nThis prevents automated tooling from parsing out the output from and individual command, for example to associate error messages or warnings with the file that caused them.\r\n\r\nPR #999 changes the status printing for dumb terminals to only print when the edge finishes, instead of when the edge starts.  This is a little less useful for a human reading the output as it runs, as you can't see what command is currently running, but I expect all interactive uses of ninja to use a smart terminal.  For dumb terminal outputs, which I expect is normally redirecting to a file, the output will always be\r\nstatus for cmd 1\r\noutput for cmd 1\r\nstatus for cmd 2\r\noutput for cmd 2\r\n\r\nParsers can use a token in NINJA_STATUS to recognize status lines, and assume everything after a status line is output from that command until the next status line is seen."},"comment":{"url":"https://api.github.com/repos/ninja-build/ninja/issues/comments/155966723","html_url":"https://github.com/ninja-build/ninja/issues/1010#issuecomment-155966723","issue_url":"https://api.github.com/repos/ninja-build/ninja/issues/1010","id":155966723,"user":{"login":"sgraham","id":1822,"avatar_url":"https://avatars.githubusercontent.com/u/1822?v=3","gravatar_id":"","url":"https://api.github.com/users/sgraham","html_url":"https://github.com/sgraham","followers_url":"https://api.github.com/users/sgraham/followers","following_url":"https://api.github.com/users/sgraham/following{/other_user}","gists_url":"https://api.github.com/users/sgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/sgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgraham/subscriptions","organizations_url":"https://api.github.com/users/sgraham/orgs","repos_url":"https://api.github.com/users/sgraham/repos","events_url":"https://api.github.com/users/sgraham/events{/privacy}","received_events_url":"https://api.github.com/users/sgraham/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T01:18:40Z","updated_at":"2015-11-12T01:18:40Z","body":"I don't feel strongly, but I do sometimes watch sloooow bot output streaming as \"pseudo\" interactive, which will be running in dumb mode, so it's sort of nice to see what's running. But it's not a big deal if the other uses are important."}}