{"action":"created","comment":{"url":"https://api.github.com/repos/zeit/xterm.js/pulls/comments/245432862","pull_request_review_id":189544584,"id":245432862,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTQzMjg2Mg==","diff_hunk":"@@ -0,0 +1,24 @@\n+// This function returns whether the first code point of the provided string is\n+// within a range that contains emoji. Some of the codepoints in these ranges\n+// are unassigned so this test is an approximation to the real thing.\n+// Ranges taken from: https://stackoverflow.com/questions/30757193/\n+// For a complete list of all assigned codepoints, go to:\n+//   https://unicode.org/Public/emoji/11.0/emoji-data.txt\n+export function isEmoji(str: string): boolean {","path":"src/Emoji.ts","position":7,"original_position":7,"commit_id":"6525f940308ce7c779bdb29fc4f8941fe95c4dc5","original_commit_id":"6525f940308ce7c779bdb29fc4f8941fe95c4dc5","user":{"login":"jerch","id":6193135,"node_id":"MDQ6VXNlcjYxOTMxMzU=","avatar_url":"https://avatars0.githubusercontent.com/u/6193135?v=4","gravatar_id":"","url":"https://api.github.com/users/jerch","html_url":"https://github.com/jerch","followers_url":"https://api.github.com/users/jerch/followers","following_url":"https://api.github.com/users/jerch/following{/other_user}","gists_url":"https://api.github.com/users/jerch/gists{/gist_id}","starred_url":"https://api.github.com/users/jerch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerch/subscriptions","organizations_url":"https://api.github.com/users/jerch/orgs","repos_url":"https://api.github.com/users/jerch/repos","events_url":"https://api.github.com/users/jerch/events{/privacy}","received_events_url":"https://api.github.com/users/jerch/received_events","type":"User","site_admin":false},"body":"Yupp thats pretty similar. The short circuit for lower chars is important imho, otherwise it will run 10 checks for every single char. The conditions could even be further tweaked to a binary search, which would lower the needed checks to ~3 per char. But since input is nothing coming in MB/s this is good as it is.\r\nBtw `codePointAt` cannot be used since its not supported by IE11. You need a polyfill that converts 2 UTF16 surrogates to a UTF32 codepoint. something like this: https://github.com/xtermjs/xterm.js/blob/d7e5977d9ab825c5c9941f7a81371b6df897c69c/src/core/input/TextDecoder.ts#L28\r\nOnce we have multiple unicode version support we should move it to the v11 definitions.","created_at":"2019-01-04T22:01:47Z","updated_at":"2019-01-04T22:18:03Z","html_url":"https://github.com/zeit/xterm.js/pull/6#discussion_r245432862","pull_request_url":"https://api.github.com/repos/zeit/xterm.js/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/comments/245432862"},"html":{"href":"https://github.com/zeit/xterm.js/pull/6#discussion_r245432862"},"pull_request":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/6"}},"in_reply_to_id":245425452},"pull_request":{"url":"https://api.github.com/repos/zeit/xterm.js/pulls/6","id":242375200,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMzc1MjAw","html_url":"https://github.com/zeit/xterm.js/pull/6","diff_url":"https://github.com/zeit/xterm.js/pull/6.diff","patch_url":"https://github.com/zeit/xterm.js/pull/6.patch","issue_url":"https://api.github.com/repos/zeit/xterm.js/issues/6","number":6,"state":"open","locked":false,"title":"Adding support for emoji input","user":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"body":"## Problems\r\nThere were multiple problems with emoji\r\n\r\n 1. Pressing cmd+ctrl+space didn't do anything\r\n 2. Opening the emoji dialog was possible but it appeared at a weird location. This was due to the textarea we use for input was not being moved with the cursor, unless a composition (i.e. IME input) was underway. \r\n 3. No emoji was received by the terminal.\r\n\r\n## Solutions\r\n\r\n 1. Hyper (mousetrap) is intercepting this key combination. This fix needs to be applied to Hyper itself\r\n 2. The textarea always moves with the cursor now.\r\n 3. Added handler for the `input` event, which is only used for emoji. Also, the textarea needs to have a `lineheight > 0` for this event to fire, at least in Chromium.\r\n\r\n## Testing\r\n\r\n - [x] IME still works. Tested with Chinese, including emoji.\r\n - [x] Emojis are inserted from the emoji input popup.\r\n - [x] The popup shows at the right location\r\n - [ ] Test on windows\r\n - [ ] Test independently of Hyper\r\n\r\n![2019-01-04_16-24](https://user-images.githubusercontent.com/1410520/50711787-477dff80-103d-11e9-81e3-e445ad383531.png)\r\n","created_at":"2019-01-04T21:19:22Z","updated_at":"2019-01-04T22:18:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2187a67e48e0f3f1321966981c997495de282754","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zeit/xterm.js/pulls/6/commits","review_comments_url":"https://api.github.com/repos/zeit/xterm.js/pulls/6/comments","review_comment_url":"https://api.github.com/repos/zeit/xterm.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeit/xterm.js/issues/6/comments","statuses_url":"https://api.github.com/repos/zeit/xterm.js/statuses/6525f940308ce7c779bdb29fc4f8941fe95c4dc5","head":{"label":"juancampa:emoji-fix","ref":"emoji-fix","sha":"6525f940308ce7c779bdb29fc4f8941fe95c4dc5","user":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"repo":{"id":160722534,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA3MjI1MzQ=","name":"xterm.js","full_name":"juancampa/xterm.js","private":false,"owner":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"html_url":"https://github.com/juancampa/xterm.js","description":"A terminal for the web","fork":true,"url":"https://api.github.com/repos/juancampa/xterm.js","forks_url":"https://api.github.com/repos/juancampa/xterm.js/forks","keys_url":"https://api.github.com/repos/juancampa/xterm.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juancampa/xterm.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juancampa/xterm.js/teams","hooks_url":"https://api.github.com/repos/juancampa/xterm.js/hooks","issue_events_url":"https://api.github.com/repos/juancampa/xterm.js/issues/events{/number}","events_url":"https://api.github.com/repos/juancampa/xterm.js/events","assignees_url":"https://api.github.com/repos/juancampa/xterm.js/assignees{/user}","branches_url":"https://api.github.com/repos/juancampa/xterm.js/branches{/branch}","tags_url":"https://api.github.com/repos/juancampa/xterm.js/tags","blobs_url":"https://api.github.com/repos/juancampa/xterm.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juancampa/xterm.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juancampa/xterm.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/juancampa/xterm.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juancampa/xterm.js/statuses/{sha}","languages_url":"https://api.github.com/repos/juancampa/xterm.js/languages","stargazers_url":"https://api.github.com/repos/juancampa/xterm.js/stargazers","contributors_url":"https://api.github.com/repos/juancampa/xterm.js/contributors","subscribers_url":"https://api.github.com/repos/juancampa/xterm.js/subscribers","subscription_url":"https://api.github.com/repos/juancampa/xterm.js/subscription","commits_url":"https://api.github.com/repos/juancampa/xterm.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/juancampa/xterm.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/juancampa/xterm.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/juancampa/xterm.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/juancampa/xterm.js/contents/{+path}","compare_url":"https://api.github.com/repos/juancampa/xterm.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juancampa/xterm.js/merges","archive_url":"https://api.github.com/repos/juancampa/xterm.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juancampa/xterm.js/downloads","issues_url":"https://api.github.com/repos/juancampa/xterm.js/issues{/number}","pulls_url":"https://api.github.com/repos/juancampa/xterm.js/pulls{/number}","milestones_url":"https://api.github.com/repos/juancampa/xterm.js/milestones{/number}","notifications_url":"https://api.github.com/repos/juancampa/xterm.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juancampa/xterm.js/labels{/name}","releases_url":"https://api.github.com/repos/juancampa/xterm.js/releases{/id}","deployments_url":"https://api.github.com/repos/juancampa/xterm.js/deployments","created_at":"2018-12-06T19:34:52Z","updated_at":"2018-12-30T22:57:38Z","pushed_at":"2019-01-04T21:04:13Z","git_url":"git://github.com/juancampa/xterm.js.git","ssh_url":"git@github.com:juancampa/xterm.js.git","clone_url":"https://github.com/juancampa/xterm.js.git","svn_url":"https://github.com/juancampa/xterm.js","homepage":"https://xtermjs.org/","size":6120,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zeit:master","ref":"master","sha":"1adeedca7765208b9cc57d98637869ab55f97e1d","user":{"login":"zeit","id":14985020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/14985020?v=4","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"repo":{"id":163710880,"node_id":"MDEwOlJlcG9zaXRvcnkxNjM3MTA4ODA=","name":"xterm.js","full_name":"zeit/xterm.js","private":false,"owner":{"login":"zeit","id":14985020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/14985020?v=4","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/zeit/xterm.js","description":"A terminal for the web","fork":true,"url":"https://api.github.com/repos/zeit/xterm.js","forks_url":"https://api.github.com/repos/zeit/xterm.js/forks","keys_url":"https://api.github.com/repos/zeit/xterm.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeit/xterm.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeit/xterm.js/teams","hooks_url":"https://api.github.com/repos/zeit/xterm.js/hooks","issue_events_url":"https://api.github.com/repos/zeit/xterm.js/issues/events{/number}","events_url":"https://api.github.com/repos/zeit/xterm.js/events","assignees_url":"https://api.github.com/repos/zeit/xterm.js/assignees{/user}","branches_url":"https://api.github.com/repos/zeit/xterm.js/branches{/branch}","tags_url":"https://api.github.com/repos/zeit/xterm.js/tags","blobs_url":"https://api.github.com/repos/zeit/xterm.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeit/xterm.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeit/xterm.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeit/xterm.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeit/xterm.js/statuses/{sha}","languages_url":"https://api.github.com/repos/zeit/xterm.js/languages","stargazers_url":"https://api.github.com/repos/zeit/xterm.js/stargazers","contributors_url":"https://api.github.com/repos/zeit/xterm.js/contributors","subscribers_url":"https://api.github.com/repos/zeit/xterm.js/subscribers","subscription_url":"https://api.github.com/repos/zeit/xterm.js/subscription","commits_url":"https://api.github.com/repos/zeit/xterm.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeit/xterm.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeit/xterm.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeit/xterm.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeit/xterm.js/contents/{+path}","compare_url":"https://api.github.com/repos/zeit/xterm.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeit/xterm.js/merges","archive_url":"https://api.github.com/repos/zeit/xterm.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeit/xterm.js/downloads","issues_url":"https://api.github.com/repos/zeit/xterm.js/issues{/number}","pulls_url":"https://api.github.com/repos/zeit/xterm.js/pulls{/number}","milestones_url":"https://api.github.com/repos/zeit/xterm.js/milestones{/number}","notifications_url":"https://api.github.com/repos/zeit/xterm.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeit/xterm.js/labels{/name}","releases_url":"https://api.github.com/repos/zeit/xterm.js/releases{/id}","deployments_url":"https://api.github.com/repos/zeit/xterm.js/deployments","created_at":"2019-01-01T03:27:14Z","updated_at":"2019-01-04T20:34:24Z","pushed_at":"2019-01-04T21:19:22Z","git_url":"git://github.com/zeit/xterm.js.git","ssh_url":"git@github.com:zeit/xterm.js.git","clone_url":"https://github.com/zeit/xterm.js.git","svn_url":"https://github.com/zeit/xterm.js","homepage":"https://xtermjs.org/","size":6190,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/6"},"html":{"href":"https://github.com/zeit/xterm.js/pull/6"},"issue":{"href":"https://api.github.com/repos/zeit/xterm.js/issues/6"},"comments":{"href":"https://api.github.com/repos/zeit/xterm.js/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeit/xterm.js/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/zeit/xterm.js/statuses/6525f940308ce7c779bdb29fc4f8941fe95c4dc5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jerch"}}