{"action":"created","comment":{"url":"https://api.github.com/repos/mbedmicro/mbed/pulls/comments/67475081","id":67475081,"diff_hunk":"@@ -0,0 +1,8 @@\n+{\n+    \"name\": \"core\",\n+    \"config\": {\n+        \"stdio-convert-newlines\": {\n+            \"help\": \"Enable conversion to standard newlines on stdin/stdout\"","path":"mbed_lib.json","position":5,"original_position":5,"commit_id":"1480c231e9d0fc0ed21c8bb808e59168713d8530","original_commit_id":"1480c231e9d0fc0ed21c8bb808e59168713d8530","user":{"login":"bogdanm","id":211717,"avatar_url":"https://avatars.githubusercontent.com/u/211717?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanm","html_url":"https://github.com/bogdanm","followers_url":"https://api.github.com/users/bogdanm/followers","following_url":"https://api.github.com/users/bogdanm/following{/other_user}","gists_url":"https://api.github.com/users/bogdanm/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanm/subscriptions","organizations_url":"https://api.github.com/users/bogdanm/orgs","repos_url":"https://api.github.com/users/bogdanm/repos","events_url":"https://api.github.com/users/bogdanm/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanm/received_events","type":"User","site_admin":false},"body":"This is technically OK, but I'd rather add a `\"value\": 0` here to make it clear that the conversion is disabled by default,  and change the condition in `retarget.cpp` to `#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES`. Not a must, it just feels a bit more clear.","created_at":"2016-06-17T08:22:39Z","updated_at":"2016-06-17T08:22:39Z","html_url":"https://github.com/mbedmicro/mbed/pull/1876#discussion_r67475081","pull_request_url":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876","_links":{"self":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/comments/67475081"},"html":{"href":"https://github.com/mbedmicro/mbed/pull/1876#discussion_r67475081"},"pull_request":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876"}}},"pull_request":{"url":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876","id":73016568,"html_url":"https://github.com/mbedmicro/mbed/pull/1876","diff_url":"https://github.com/mbedmicro/mbed/pull/1876.diff","patch_url":"https://github.com/mbedmicro/mbed/pull/1876.patch","issue_url":"https://api.github.com/repos/mbedmicro/mbed/issues/1876","number":1876,"state":"open","locked":false,"title":"Add newline conversion for stdout","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars.githubusercontent.com/u/1075160?v=3","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"body":"As noted by @kjbracey-arm, mbed currently prints \\r and \\n unmodified to stdout and most serial terminals default to requiring a \\r\\n sequence to actually create a newline. This results in non-standard io for many setups, since the C standard states that \\n will be converted to the underlying newline sequence[[1]](https://en.wikipedia.org/wiki/Newline#In_programming_languages). Annoyingly, this has resulted in the \\r\\n being used in many programs.\r\n\r\nIn this patch, stdout/stdin do the following conversions greedily (without delays):\r\n\r\non write:\r\n```\r\n\\n   -> \\r\\n\r\n\\r\\n -> \\r\\n\r\n\\r   -> \\r\r\n\\n\\r -> \\n\\r\r\n```\r\non read:\r\n```\r\n\\n   -> \\n\r\n\\r\\n -> \\n\r\n\\r   -> \\n\r\n\\n\\r -> \\n\r\n```\r\n\r\nSerial.output provides support for unmodified binary output (and still requires \\r\\n). This conversion remains backwards compatibly for all \\r\\n sequences and only impacts stdio that uses \\n or \\r in isolation.\r\n\r\ncc @kjbracey-arm, @bogdanm \r\nmv [#91](https://github.com/ARMmbed/mbed-os/issues/91), [#93](https://github.com/ARMmbed/mbed-os/pull/93)","created_at":"2016-06-08T09:49:02Z","updated_at":"2016-06-17T08:22:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aefb2d31af148b65da985c409f0411be6af50d94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876/commits","review_comments_url":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876/comments","review_comment_url":"https://api.github.com/repos/mbedmicro/mbed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mbedmicro/mbed/issues/1876/comments","statuses_url":"https://api.github.com/repos/mbedmicro/mbed/statuses/1480c231e9d0fc0ed21c8bb808e59168713d8530","head":{"label":"geky:newline-conversion","ref":"newline-conversion","sha":"1480c231e9d0fc0ed21c8bb808e59168713d8530","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars.githubusercontent.com/u/1075160?v=3","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"repo":{"id":59693534,"name":"mbed","full_name":"geky/mbed","owner":{"login":"geky","id":1075160,"avatar_url":"https://avatars.githubusercontent.com/u/1075160?v=3","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geky/mbed","description":"mbed libraries and tools (Classic). For mbed OS, look here: https://www.mbed.com/en/development/software/mbed-os/","fork":true,"url":"https://api.github.com/repos/geky/mbed","forks_url":"https://api.github.com/repos/geky/mbed/forks","keys_url":"https://api.github.com/repos/geky/mbed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geky/mbed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geky/mbed/teams","hooks_url":"https://api.github.com/repos/geky/mbed/hooks","issue_events_url":"https://api.github.com/repos/geky/mbed/issues/events{/number}","events_url":"https://api.github.com/repos/geky/mbed/events","assignees_url":"https://api.github.com/repos/geky/mbed/assignees{/user}","branches_url":"https://api.github.com/repos/geky/mbed/branches{/branch}","tags_url":"https://api.github.com/repos/geky/mbed/tags","blobs_url":"https://api.github.com/repos/geky/mbed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geky/mbed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geky/mbed/git/refs{/sha}","trees_url":"https://api.github.com/repos/geky/mbed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geky/mbed/statuses/{sha}","languages_url":"https://api.github.com/repos/geky/mbed/languages","stargazers_url":"https://api.github.com/repos/geky/mbed/stargazers","contributors_url":"https://api.github.com/repos/geky/mbed/contributors","subscribers_url":"https://api.github.com/repos/geky/mbed/subscribers","subscription_url":"https://api.github.com/repos/geky/mbed/subscription","commits_url":"https://api.github.com/repos/geky/mbed/commits{/sha}","git_commits_url":"https://api.github.com/repos/geky/mbed/git/commits{/sha}","comments_url":"https://api.github.com/repos/geky/mbed/comments{/number}","issue_comment_url":"https://api.github.com/repos/geky/mbed/issues/comments{/number}","contents_url":"https://api.github.com/repos/geky/mbed/contents/{+path}","compare_url":"https://api.github.com/repos/geky/mbed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geky/mbed/merges","archive_url":"https://api.github.com/repos/geky/mbed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geky/mbed/downloads","issues_url":"https://api.github.com/repos/geky/mbed/issues{/number}","pulls_url":"https://api.github.com/repos/geky/mbed/pulls{/number}","milestones_url":"https://api.github.com/repos/geky/mbed/milestones{/number}","notifications_url":"https://api.github.com/repos/geky/mbed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geky/mbed/labels{/name}","releases_url":"https://api.github.com/repos/geky/mbed/releases{/id}","deployments_url":"https://api.github.com/repos/geky/mbed/deployments","created_at":"2016-05-25T19:59:10Z","updated_at":"2016-05-25T20:00:07Z","pushed_at":"2016-06-16T17:04:00Z","git_url":"git://github.com/geky/mbed.git","ssh_url":"git@github.com:geky/mbed.git","clone_url":"https://github.com/geky/mbed.git","svn_url":"https://github.com/geky/mbed","homepage":"","size":45093,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mbedmicro:master","ref":"master","sha":"42561b91931e793fe0151fbd3852c924fe394016","user":{"login":"mbedmicro","id":3626466,"avatar_url":"https://avatars.githubusercontent.com/u/3626466?v=3","gravatar_id":"","url":"https://api.github.com/users/mbedmicro","html_url":"https://github.com/mbedmicro","followers_url":"https://api.github.com/users/mbedmicro/followers","following_url":"https://api.github.com/users/mbedmicro/following{/other_user}","gists_url":"https://api.github.com/users/mbedmicro/gists{/gist_id}","starred_url":"https://api.github.com/users/mbedmicro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbedmicro/subscriptions","organizations_url":"https://api.github.com/users/mbedmicro/orgs","repos_url":"https://api.github.com/users/mbedmicro/repos","events_url":"https://api.github.com/users/mbedmicro/events{/privacy}","received_events_url":"https://api.github.com/users/mbedmicro/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed","full_name":"mbedmicro/mbed","owner":{"login":"mbedmicro","id":3626466,"avatar_url":"https://avatars.githubusercontent.com/u/3626466?v=3","gravatar_id":"","url":"https://api.github.com/users/mbedmicro","html_url":"https://github.com/mbedmicro","followers_url":"https://api.github.com/users/mbedmicro/followers","following_url":"https://api.github.com/users/mbedmicro/following{/other_user}","gists_url":"https://api.github.com/users/mbedmicro/gists{/gist_id}","starred_url":"https://api.github.com/users/mbedmicro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbedmicro/subscriptions","organizations_url":"https://api.github.com/users/mbedmicro/orgs","repos_url":"https://api.github.com/users/mbedmicro/repos","events_url":"https://api.github.com/users/mbedmicro/events{/privacy}","received_events_url":"https://api.github.com/users/mbedmicro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mbedmicro/mbed","description":"mbed libraries and tools (Classic). For mbed OS, look here: https://www.mbed.com/en/development/software/mbed-os/","fork":false,"url":"https://api.github.com/repos/mbedmicro/mbed","forks_url":"https://api.github.com/repos/mbedmicro/mbed/forks","keys_url":"https://api.github.com/repos/mbedmicro/mbed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbedmicro/mbed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbedmicro/mbed/teams","hooks_url":"https://api.github.com/repos/mbedmicro/mbed/hooks","issue_events_url":"https://api.github.com/repos/mbedmicro/mbed/issues/events{/number}","events_url":"https://api.github.com/repos/mbedmicro/mbed/events","assignees_url":"https://api.github.com/repos/mbedmicro/mbed/assignees{/user}","branches_url":"https://api.github.com/repos/mbedmicro/mbed/branches{/branch}","tags_url":"https://api.github.com/repos/mbedmicro/mbed/tags","blobs_url":"https://api.github.com/repos/mbedmicro/mbed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbedmicro/mbed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbedmicro/mbed/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbedmicro/mbed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbedmicro/mbed/statuses/{sha}","languages_url":"https://api.github.com/repos/mbedmicro/mbed/languages","stargazers_url":"https://api.github.com/repos/mbedmicro/mbed/stargazers","contributors_url":"https://api.github.com/repos/mbedmicro/mbed/contributors","subscribers_url":"https://api.github.com/repos/mbedmicro/mbed/subscribers","subscription_url":"https://api.github.com/repos/mbedmicro/mbed/subscription","commits_url":"https://api.github.com/repos/mbedmicro/mbed/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbedmicro/mbed/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbedmicro/mbed/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbedmicro/mbed/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbedmicro/mbed/contents/{+path}","compare_url":"https://api.github.com/repos/mbedmicro/mbed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbedmicro/mbed/merges","archive_url":"https://api.github.com/repos/mbedmicro/mbed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbedmicro/mbed/downloads","issues_url":"https://api.github.com/repos/mbedmicro/mbed/issues{/number}","pulls_url":"https://api.github.com/repos/mbedmicro/mbed/pulls{/number}","milestones_url":"https://api.github.com/repos/mbedmicro/mbed/milestones{/number}","notifications_url":"https://api.github.com/repos/mbedmicro/mbed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbedmicro/mbed/labels{/name}","releases_url":"https://api.github.com/repos/mbedmicro/mbed/releases{/id}","deployments_url":"https://api.github.com/repos/mbedmicro/mbed/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2016-06-13T16:33:27Z","pushed_at":"2016-06-17T06:31:46Z","git_url":"git://github.com/mbedmicro/mbed.git","ssh_url":"git@github.com:mbedmicro/mbed.git","clone_url":"https://github.com/mbedmicro/mbed.git","svn_url":"https://github.com/mbedmicro/mbed","homepage":"","size":53612,"stargazers_count":670,"watchers_count":670,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":670,"mirror_url":null,"open_issues_count":212,"forks":670,"open_issues":212,"watchers":670,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876"},"html":{"href":"https://github.com/mbedmicro/mbed/pull/1876"},"issue":{"href":"https://api.github.com/repos/mbedmicro/mbed/issues/1876"},"comments":{"href":"https://api.github.com/repos/mbedmicro/mbed/issues/1876/comments"},"review_comments":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876/comments"},"review_comment":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mbedmicro/mbed/pulls/1876/commits"},"statuses":{"href":"https://api.github.com/repos/mbedmicro/mbed/statuses/1480c231e9d0fc0ed21c8bb808e59168713d8530"}}}}
{"actor":{"display_login":"bogdanm"}}