{"action":"created","comment":{"url":"https://api.github.com/repos/copy/v86/pulls/comments/179927600","pull_request_review_id":110266876,"id":179927600,"diff_hunk":"@@ -42,28 +44,57 @@ function SerialAdapter(element, bus)\n     };\n     this.init();\n \n-\n     this.show_char = function(chr)\n     {\n-        if(chr === \"\\x08\")\n-        {\n-            this.text = this.text.slice(0, -1);\n-            this.update();\n-        }\n-        else if(chr === \"\\r\")\n-        {\n-            // do nothing\n+        if(this.control_mode === false) {\n+            if(chr === \"\\x08\")\n+            {\n+                this.text = this.text.slice(0, -1);\n+                this.update();\n+            }\n+            else if(chr === \"\\x1b\") {\n+               this.control_mode = true;\n+               this.control_buffer = \"\";\n+            }\n+            else if(chr === \"\\r\")\n+            {\n+                // do nothing\n+            }\n+            else\n+            {\n+               this.text += chr;\n+\n+               if(chr === \"\\n\")\n+               {\n+                  this.text_new_line = true;\n+               }\n+\n+               this.update();\n+            }\n         }\n         else\n         {\n-            this.text += chr;\n-\n-            if(chr === \"\\n\")\n+            this.control_buffer += chr;\n+            var cmds = {\n+                bksp: /$\\[.J^/,\n+                clr: /$\\[.H\\x1B\\[.J^/,\n+                invalid: /$*[^HJ]^/","path":"src/browser/serial.js","position":59,"original_position":59,"commit_id":"e48f156defe0485110e485bbed1a9dcdf9804022","original_commit_id":"e48f156defe0485110e485bbed1a9dcdf9804022","user":{"login":"nununoisy","id":9949555,"avatar_url":"https://avatars3.githubusercontent.com/u/9949555?v=4","gravatar_id":"","url":"https://api.github.com/users/nununoisy","html_url":"https://github.com/nununoisy","followers_url":"https://api.github.com/users/nununoisy/followers","following_url":"https://api.github.com/users/nununoisy/following{/other_user}","gists_url":"https://api.github.com/users/nununoisy/gists{/gist_id}","starred_url":"https://api.github.com/users/nununoisy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nununoisy/subscriptions","organizations_url":"https://api.github.com/users/nununoisy/orgs","repos_url":"https://api.github.com/users/nununoisy/repos","events_url":"https://api.github.com/users/nununoisy/events{/privacy}","received_events_url":"https://api.github.com/users/nununoisy/received_events","type":"User","site_admin":false},"body":"Whoops! I'm still getting the hang of regex. Silly mistakes.","created_at":"2018-04-07T20:54:17Z","updated_at":"2018-04-07T20:54:17Z","html_url":"https://github.com/copy/v86/pull/204#discussion_r179927600","pull_request_url":"https://api.github.com/repos/copy/v86/pulls/204","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/copy/v86/pulls/comments/179927600"},"html":{"href":"https://github.com/copy/v86/pull/204#discussion_r179927600"},"pull_request":{"href":"https://api.github.com/repos/copy/v86/pulls/204"}},"in_reply_to_id":179923880},"pull_request":{"url":"https://api.github.com/repos/copy/v86/pulls/204","id":179993708,"html_url":"https://github.com/copy/v86/pull/204","diff_url":"https://github.com/copy/v86/pull/204.diff","patch_url":"https://github.com/copy/v86/pull/204.patch","issue_url":"https://api.github.com/repos/copy/v86/issues/204","number":204,"state":"open","locked":false,"title":"Add basic ANSI escape character control support","user":{"login":"nununoisy","id":9949555,"avatar_url":"https://avatars3.githubusercontent.com/u/9949555?v=4","gravatar_id":"","url":"https://api.github.com/users/nununoisy","html_url":"https://github.com/nununoisy","followers_url":"https://api.github.com/users/nununoisy/followers","following_url":"https://api.github.com/users/nununoisy/following{/other_user}","gists_url":"https://api.github.com/users/nununoisy/gists{/gist_id}","starred_url":"https://api.github.com/users/nununoisy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nununoisy/subscriptions","organizations_url":"https://api.github.com/users/nununoisy/orgs","repos_url":"https://api.github.com/users/nununoisy/repos","events_url":"https://api.github.com/users/nununoisy/events{/privacy}","received_events_url":"https://api.github.com/users/nununoisy/received_events","type":"User","site_admin":false},"body":"Add support for readability in serial terminal\r\n\r\nCommands:\r\n^[J - normally clears screen to the right, simply ignored here\r\n^[H^[J - home cursor, clear screen to the right - clears textarea","created_at":"2018-04-06T16:18:47Z","updated_at":"2018-04-07T20:54:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4e3c9bc4dece8231bb842d52fc5580a5df4f0ca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/copy/v86/pulls/204/commits","review_comments_url":"https://api.github.com/repos/copy/v86/pulls/204/comments","review_comment_url":"https://api.github.com/repos/copy/v86/pulls/comments{/number}","comments_url":"https://api.github.com/repos/copy/v86/issues/204/comments","statuses_url":"https://api.github.com/repos/copy/v86/statuses/e48f156defe0485110e485bbed1a9dcdf9804022","head":{"label":"nununoisy:master","ref":"master","sha":"e48f156defe0485110e485bbed1a9dcdf9804022","user":{"login":"nununoisy","id":9949555,"avatar_url":"https://avatars3.githubusercontent.com/u/9949555?v=4","gravatar_id":"","url":"https://api.github.com/users/nununoisy","html_url":"https://github.com/nununoisy","followers_url":"https://api.github.com/users/nununoisy/followers","following_url":"https://api.github.com/users/nununoisy/following{/other_user}","gists_url":"https://api.github.com/users/nununoisy/gists{/gist_id}","starred_url":"https://api.github.com/users/nununoisy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nununoisy/subscriptions","organizations_url":"https://api.github.com/users/nununoisy/orgs","repos_url":"https://api.github.com/users/nununoisy/repos","events_url":"https://api.github.com/users/nununoisy/events{/privacy}","received_events_url":"https://api.github.com/users/nununoisy/received_events","type":"User","site_admin":false},"repo":{"id":128408367,"name":"v86","full_name":"nununoisy/v86","owner":{"login":"nununoisy","id":9949555,"avatar_url":"https://avatars3.githubusercontent.com/u/9949555?v=4","gravatar_id":"","url":"https://api.github.com/users/nununoisy","html_url":"https://github.com/nununoisy","followers_url":"https://api.github.com/users/nununoisy/followers","following_url":"https://api.github.com/users/nununoisy/following{/other_user}","gists_url":"https://api.github.com/users/nununoisy/gists{/gist_id}","starred_url":"https://api.github.com/users/nununoisy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nununoisy/subscriptions","organizations_url":"https://api.github.com/users/nununoisy/orgs","repos_url":"https://api.github.com/users/nununoisy/repos","events_url":"https://api.github.com/users/nununoisy/events{/privacy}","received_events_url":"https://api.github.com/users/nununoisy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nununoisy/v86","description":"x86 virtualization in JavaScript, running in your browser and NodeJS","fork":true,"url":"https://api.github.com/repos/nununoisy/v86","forks_url":"https://api.github.com/repos/nununoisy/v86/forks","keys_url":"https://api.github.com/repos/nununoisy/v86/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nununoisy/v86/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nununoisy/v86/teams","hooks_url":"https://api.github.com/repos/nununoisy/v86/hooks","issue_events_url":"https://api.github.com/repos/nununoisy/v86/issues/events{/number}","events_url":"https://api.github.com/repos/nununoisy/v86/events","assignees_url":"https://api.github.com/repos/nununoisy/v86/assignees{/user}","branches_url":"https://api.github.com/repos/nununoisy/v86/branches{/branch}","tags_url":"https://api.github.com/repos/nununoisy/v86/tags","blobs_url":"https://api.github.com/repos/nununoisy/v86/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nununoisy/v86/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nununoisy/v86/git/refs{/sha}","trees_url":"https://api.github.com/repos/nununoisy/v86/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nununoisy/v86/statuses/{sha}","languages_url":"https://api.github.com/repos/nununoisy/v86/languages","stargazers_url":"https://api.github.com/repos/nununoisy/v86/stargazers","contributors_url":"https://api.github.com/repos/nununoisy/v86/contributors","subscribers_url":"https://api.github.com/repos/nununoisy/v86/subscribers","subscription_url":"https://api.github.com/repos/nununoisy/v86/subscription","commits_url":"https://api.github.com/repos/nununoisy/v86/commits{/sha}","git_commits_url":"https://api.github.com/repos/nununoisy/v86/git/commits{/sha}","comments_url":"https://api.github.com/repos/nununoisy/v86/comments{/number}","issue_comment_url":"https://api.github.com/repos/nununoisy/v86/issues/comments{/number}","contents_url":"https://api.github.com/repos/nununoisy/v86/contents/{+path}","compare_url":"https://api.github.com/repos/nununoisy/v86/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nununoisy/v86/merges","archive_url":"https://api.github.com/repos/nununoisy/v86/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nununoisy/v86/downloads","issues_url":"https://api.github.com/repos/nununoisy/v86/issues{/number}","pulls_url":"https://api.github.com/repos/nununoisy/v86/pulls{/number}","milestones_url":"https://api.github.com/repos/nununoisy/v86/milestones{/number}","notifications_url":"https://api.github.com/repos/nununoisy/v86/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nununoisy/v86/labels{/name}","releases_url":"https://api.github.com/repos/nununoisy/v86/releases{/id}","deployments_url":"https://api.github.com/repos/nununoisy/v86/deployments","created_at":"2018-04-06T14:51:42Z","updated_at":"2018-04-06T16:17:13Z","pushed_at":"2018-04-06T16:17:11Z","git_url":"git://github.com/nununoisy/v86.git","ssh_url":"git@github.com:nununoisy/v86.git","clone_url":"https://github.com/nununoisy/v86.git","svn_url":"https://github.com/nununoisy/v86","homepage":null,"size":10174,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"copy:master","ref":"master","sha":"4447a52e14a04281c8d397a8e8ab337c8f49233f","user":{"login":"copy","id":1816456,"avatar_url":"https://avatars3.githubusercontent.com/u/1816456?v=4","gravatar_id":"","url":"https://api.github.com/users/copy","html_url":"https://github.com/copy","followers_url":"https://api.github.com/users/copy/followers","following_url":"https://api.github.com/users/copy/following{/other_user}","gists_url":"https://api.github.com/users/copy/gists{/gist_id}","starred_url":"https://api.github.com/users/copy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copy/subscriptions","organizations_url":"https://api.github.com/users/copy/orgs","repos_url":"https://api.github.com/users/copy/repos","events_url":"https://api.github.com/users/copy/events{/privacy}","received_events_url":"https://api.github.com/users/copy/received_events","type":"User","site_admin":false},"repo":{"id":14158237,"name":"v86","full_name":"copy/v86","owner":{"login":"copy","id":1816456,"avatar_url":"https://avatars3.githubusercontent.com/u/1816456?v=4","gravatar_id":"","url":"https://api.github.com/users/copy","html_url":"https://github.com/copy","followers_url":"https://api.github.com/users/copy/followers","following_url":"https://api.github.com/users/copy/following{/other_user}","gists_url":"https://api.github.com/users/copy/gists{/gist_id}","starred_url":"https://api.github.com/users/copy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copy/subscriptions","organizations_url":"https://api.github.com/users/copy/orgs","repos_url":"https://api.github.com/users/copy/repos","events_url":"https://api.github.com/users/copy/events{/privacy}","received_events_url":"https://api.github.com/users/copy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/copy/v86","description":"x86 virtualization in JavaScript, running in your browser and NodeJS","fork":false,"url":"https://api.github.com/repos/copy/v86","forks_url":"https://api.github.com/repos/copy/v86/forks","keys_url":"https://api.github.com/repos/copy/v86/keys{/key_id}","collaborators_url":"https://api.github.com/repos/copy/v86/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/copy/v86/teams","hooks_url":"https://api.github.com/repos/copy/v86/hooks","issue_events_url":"https://api.github.com/repos/copy/v86/issues/events{/number}","events_url":"https://api.github.com/repos/copy/v86/events","assignees_url":"https://api.github.com/repos/copy/v86/assignees{/user}","branches_url":"https://api.github.com/repos/copy/v86/branches{/branch}","tags_url":"https://api.github.com/repos/copy/v86/tags","blobs_url":"https://api.github.com/repos/copy/v86/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/copy/v86/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/copy/v86/git/refs{/sha}","trees_url":"https://api.github.com/repos/copy/v86/git/trees{/sha}","statuses_url":"https://api.github.com/repos/copy/v86/statuses/{sha}","languages_url":"https://api.github.com/repos/copy/v86/languages","stargazers_url":"https://api.github.com/repos/copy/v86/stargazers","contributors_url":"https://api.github.com/repos/copy/v86/contributors","subscribers_url":"https://api.github.com/repos/copy/v86/subscribers","subscription_url":"https://api.github.com/repos/copy/v86/subscription","commits_url":"https://api.github.com/repos/copy/v86/commits{/sha}","git_commits_url":"https://api.github.com/repos/copy/v86/git/commits{/sha}","comments_url":"https://api.github.com/repos/copy/v86/comments{/number}","issue_comment_url":"https://api.github.com/repos/copy/v86/issues/comments{/number}","contents_url":"https://api.github.com/repos/copy/v86/contents/{+path}","compare_url":"https://api.github.com/repos/copy/v86/compare/{base}...{head}","merges_url":"https://api.github.com/repos/copy/v86/merges","archive_url":"https://api.github.com/repos/copy/v86/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/copy/v86/downloads","issues_url":"https://api.github.com/repos/copy/v86/issues{/number}","pulls_url":"https://api.github.com/repos/copy/v86/pulls{/number}","milestones_url":"https://api.github.com/repos/copy/v86/milestones{/number}","notifications_url":"https://api.github.com/repos/copy/v86/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/copy/v86/labels{/name}","releases_url":"https://api.github.com/repos/copy/v86/releases{/id}","deployments_url":"https://api.github.com/repos/copy/v86/deployments","created_at":"2013-11-06T00:12:12Z","updated_at":"2018-04-07T17:20:40Z","pushed_at":"2018-04-07T20:48:00Z","git_url":"git://github.com/copy/v86.git","ssh_url":"git@github.com:copy/v86.git","clone_url":"https://github.com/copy/v86.git","svn_url":"https://github.com/copy/v86","homepage":null,"size":10157,"stargazers_count":4322,"watchers_count":4322,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":400,"open_issues":29,"watchers":4322,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/copy/v86/pulls/204"},"html":{"href":"https://github.com/copy/v86/pull/204"},"issue":{"href":"https://api.github.com/repos/copy/v86/issues/204"},"comments":{"href":"https://api.github.com/repos/copy/v86/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/copy/v86/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/copy/v86/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/copy/v86/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/copy/v86/statuses/e48f156defe0485110e485bbed1a9dcdf9804022"}},"author_association":"NONE"}}
{"actor":{"display_login":"nununoisy"}}