{"action":"created","comment":{"url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/comments/188795969","pull_request_review_id":120847792,"id":188795969,"diff_hunk":"@@ -405,6 +409,17 @@ function addCommands(app: JupyterLab, tracker: InstanceTracker<FileBrowser>, bro\n     label: 'Copy Shareable Link'\n   });\n \n+  commands.addCommand(CommandIDs.copyPath, {\n+    execute: () => {\n+      const path = browser.selectedItems().next().path;","path":"packages/filebrowser-extension/src/index.ts","position":17,"original_position":17,"commit_id":"50e18bc2b2f50b5780f8e4934923d82f2d0e9871","original_commit_id":"50e18bc2b2f50b5780f8e4934923d82f2d0e9871","user":{"login":"ian-r-rose","id":5728311,"avatar_url":"https://avatars3.githubusercontent.com/u/5728311?v=4","gravatar_id":"","url":"https://api.github.com/users/ian-r-rose","html_url":"https://github.com/ian-r-rose","followers_url":"https://api.github.com/users/ian-r-rose/followers","following_url":"https://api.github.com/users/ian-r-rose/following{/other_user}","gists_url":"https://api.github.com/users/ian-r-rose/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-r-rose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-r-rose/subscriptions","organizations_url":"https://api.github.com/users/ian-r-rose/orgs","repos_url":"https://api.github.com/users/ian-r-rose/repos","events_url":"https://api.github.com/users/ian-r-rose/events{/privacy}","received_events_url":"https://api.github.com/users/ian-r-rose/received_events","type":"User","site_admin":false},"body":"Strictly speaking, I think it is possible for this command to be executed when there are not any selected items, so the first item grabbed from the iterator can be `undefined`. A slightly more defensive way of doing this would be to write\r\n```typescript\r\nconst item = browser.selectedItems().next();\r\nif (!item) {\r\n  return;\r\n}\r\nClipboard.copyToSystem(item.path);\r\n```","created_at":"2018-05-16T22:55:04Z","updated_at":"2018-05-16T22:55:57Z","html_url":"https://github.com/jupyterlab/jupyterlab/pull/4582#discussion_r188795969","pull_request_url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/comments/188795969"},"html":{"href":"https://github.com/jupyterlab/jupyterlab/pull/4582#discussion_r188795969"},"pull_request":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582"}}},"pull_request":{"url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582","id":188472455,"html_url":"https://github.com/jupyterlab/jupyterlab/pull/4582","diff_url":"https://github.com/jupyterlab/jupyterlab/pull/4582.diff","patch_url":"https://github.com/jupyterlab/jupyterlab/pull/4582.patch","issue_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/4582","number":4582,"state":"open","locked":false,"title":"Add a 'Copy Path' to filebrowser context menu.","user":{"login":"aisipos","id":68444,"avatar_url":"https://avatars0.githubusercontent.com/u/68444?v=4","gravatar_id":"","url":"https://api.github.com/users/aisipos","html_url":"https://github.com/aisipos","followers_url":"https://api.github.com/users/aisipos/followers","following_url":"https://api.github.com/users/aisipos/following{/other_user}","gists_url":"https://api.github.com/users/aisipos/gists{/gist_id}","starred_url":"https://api.github.com/users/aisipos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aisipos/subscriptions","organizations_url":"https://api.github.com/users/aisipos/orgs","repos_url":"https://api.github.com/users/aisipos/repos","events_url":"https://api.github.com/users/aisipos/events{/privacy}","received_events_url":"https://api.github.com/users/aisipos/received_events","type":"User","site_admin":false},"body":"Fixes #3845","created_at":"2018-05-16T15:28:40Z","updated_at":"2018-05-16T22:55:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4bad892062bcff80c37d989f95c82ee8d37e244","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582/commits","review_comments_url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582/comments","review_comment_url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/4582/comments","statuses_url":"https://api.github.com/repos/jupyterlab/jupyterlab/statuses/50e18bc2b2f50b5780f8e4934923d82f2d0e9871","head":{"label":"aisipos:filebrowser-copy-path","ref":"filebrowser-copy-path","sha":"50e18bc2b2f50b5780f8e4934923d82f2d0e9871","user":{"login":"aisipos","id":68444,"avatar_url":"https://avatars0.githubusercontent.com/u/68444?v=4","gravatar_id":"","url":"https://api.github.com/users/aisipos","html_url":"https://github.com/aisipos","followers_url":"https://api.github.com/users/aisipos/followers","following_url":"https://api.github.com/users/aisipos/following{/other_user}","gists_url":"https://api.github.com/users/aisipos/gists{/gist_id}","starred_url":"https://api.github.com/users/aisipos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aisipos/subscriptions","organizations_url":"https://api.github.com/users/aisipos/orgs","repos_url":"https://api.github.com/users/aisipos/repos","events_url":"https://api.github.com/users/aisipos/events{/privacy}","received_events_url":"https://api.github.com/users/aisipos/received_events","type":"User","site_admin":false},"repo":{"id":133573466,"name":"jupyterlab","full_name":"aisipos/jupyterlab","owner":{"login":"aisipos","id":68444,"avatar_url":"https://avatars0.githubusercontent.com/u/68444?v=4","gravatar_id":"","url":"https://api.github.com/users/aisipos","html_url":"https://github.com/aisipos","followers_url":"https://api.github.com/users/aisipos/followers","following_url":"https://api.github.com/users/aisipos/following{/other_user}","gists_url":"https://api.github.com/users/aisipos/gists{/gist_id}","starred_url":"https://api.github.com/users/aisipos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aisipos/subscriptions","organizations_url":"https://api.github.com/users/aisipos/orgs","repos_url":"https://api.github.com/users/aisipos/repos","events_url":"https://api.github.com/users/aisipos/events{/privacy}","received_events_url":"https://api.github.com/users/aisipos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aisipos/jupyterlab","description":"JupyterLab computational environment.","fork":true,"url":"https://api.github.com/repos/aisipos/jupyterlab","forks_url":"https://api.github.com/repos/aisipos/jupyterlab/forks","keys_url":"https://api.github.com/repos/aisipos/jupyterlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aisipos/jupyterlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aisipos/jupyterlab/teams","hooks_url":"https://api.github.com/repos/aisipos/jupyterlab/hooks","issue_events_url":"https://api.github.com/repos/aisipos/jupyterlab/issues/events{/number}","events_url":"https://api.github.com/repos/aisipos/jupyterlab/events","assignees_url":"https://api.github.com/repos/aisipos/jupyterlab/assignees{/user}","branches_url":"https://api.github.com/repos/aisipos/jupyterlab/branches{/branch}","tags_url":"https://api.github.com/repos/aisipos/jupyterlab/tags","blobs_url":"https://api.github.com/repos/aisipos/jupyterlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aisipos/jupyterlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aisipos/jupyterlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/aisipos/jupyterlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aisipos/jupyterlab/statuses/{sha}","languages_url":"https://api.github.com/repos/aisipos/jupyterlab/languages","stargazers_url":"https://api.github.com/repos/aisipos/jupyterlab/stargazers","contributors_url":"https://api.github.com/repos/aisipos/jupyterlab/contributors","subscribers_url":"https://api.github.com/repos/aisipos/jupyterlab/subscribers","subscription_url":"https://api.github.com/repos/aisipos/jupyterlab/subscription","commits_url":"https://api.github.com/repos/aisipos/jupyterlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/aisipos/jupyterlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/aisipos/jupyterlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/aisipos/jupyterlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/aisipos/jupyterlab/contents/{+path}","compare_url":"https://api.github.com/repos/aisipos/jupyterlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aisipos/jupyterlab/merges","archive_url":"https://api.github.com/repos/aisipos/jupyterlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aisipos/jupyterlab/downloads","issues_url":"https://api.github.com/repos/aisipos/jupyterlab/issues{/number}","pulls_url":"https://api.github.com/repos/aisipos/jupyterlab/pulls{/number}","milestones_url":"https://api.github.com/repos/aisipos/jupyterlab/milestones{/number}","notifications_url":"https://api.github.com/repos/aisipos/jupyterlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aisipos/jupyterlab/labels{/name}","releases_url":"https://api.github.com/repos/aisipos/jupyterlab/releases{/id}","deployments_url":"https://api.github.com/repos/aisipos/jupyterlab/deployments","created_at":"2018-05-15T21:07:40Z","updated_at":"2018-05-16T15:26:44Z","pushed_at":"2018-05-16T18:21:02Z","git_url":"git://github.com/aisipos/jupyterlab.git","ssh_url":"git@github.com:aisipos/jupyterlab.git","clone_url":"https://github.com/aisipos/jupyterlab.git","svn_url":"https://github.com/aisipos/jupyterlab","homepage":"","size":57022,"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":"jupyterlab:master","ref":"master","sha":"b16e635d4e7c6d39f27b7421e045238904066104","user":{"login":"jupyterlab","id":22800682,"avatar_url":"https://avatars1.githubusercontent.com/u/22800682?v=4","gravatar_id":"","url":"https://api.github.com/users/jupyterlab","html_url":"https://github.com/jupyterlab","followers_url":"https://api.github.com/users/jupyterlab/followers","following_url":"https://api.github.com/users/jupyterlab/following{/other_user}","gists_url":"https://api.github.com/users/jupyterlab/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterlab/subscriptions","organizations_url":"https://api.github.com/users/jupyterlab/orgs","repos_url":"https://api.github.com/users/jupyterlab/repos","events_url":"https://api.github.com/users/jupyterlab/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterlab/received_events","type":"Organization","site_admin":false},"repo":{"id":60374819,"name":"jupyterlab","full_name":"jupyterlab/jupyterlab","owner":{"login":"jupyterlab","id":22800682,"avatar_url":"https://avatars1.githubusercontent.com/u/22800682?v=4","gravatar_id":"","url":"https://api.github.com/users/jupyterlab","html_url":"https://github.com/jupyterlab","followers_url":"https://api.github.com/users/jupyterlab/followers","following_url":"https://api.github.com/users/jupyterlab/following{/other_user}","gists_url":"https://api.github.com/users/jupyterlab/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterlab/subscriptions","organizations_url":"https://api.github.com/users/jupyterlab/orgs","repos_url":"https://api.github.com/users/jupyterlab/repos","events_url":"https://api.github.com/users/jupyterlab/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyterlab/jupyterlab","description":"JupyterLab computational environment.","fork":false,"url":"https://api.github.com/repos/jupyterlab/jupyterlab","forks_url":"https://api.github.com/repos/jupyterlab/jupyterlab/forks","keys_url":"https://api.github.com/repos/jupyterlab/jupyterlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyterlab/jupyterlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyterlab/jupyterlab/teams","hooks_url":"https://api.github.com/repos/jupyterlab/jupyterlab/hooks","issue_events_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/events{/number}","events_url":"https://api.github.com/repos/jupyterlab/jupyterlab/events","assignees_url":"https://api.github.com/repos/jupyterlab/jupyterlab/assignees{/user}","branches_url":"https://api.github.com/repos/jupyterlab/jupyterlab/branches{/branch}","tags_url":"https://api.github.com/repos/jupyterlab/jupyterlab/tags","blobs_url":"https://api.github.com/repos/jupyterlab/jupyterlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyterlab/jupyterlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyterlab/jupyterlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyterlab/jupyterlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyterlab/jupyterlab/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyterlab/jupyterlab/languages","stargazers_url":"https://api.github.com/repos/jupyterlab/jupyterlab/stargazers","contributors_url":"https://api.github.com/repos/jupyterlab/jupyterlab/contributors","subscribers_url":"https://api.github.com/repos/jupyterlab/jupyterlab/subscribers","subscription_url":"https://api.github.com/repos/jupyterlab/jupyterlab/subscription","commits_url":"https://api.github.com/repos/jupyterlab/jupyterlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyterlab/jupyterlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyterlab/jupyterlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyterlab/jupyterlab/contents/{+path}","compare_url":"https://api.github.com/repos/jupyterlab/jupyterlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyterlab/jupyterlab/merges","archive_url":"https://api.github.com/repos/jupyterlab/jupyterlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyterlab/jupyterlab/downloads","issues_url":"https://api.github.com/repos/jupyterlab/jupyterlab/issues{/number}","pulls_url":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyterlab/jupyterlab/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyterlab/jupyterlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyterlab/jupyterlab/labels{/name}","releases_url":"https://api.github.com/repos/jupyterlab/jupyterlab/releases{/id}","deployments_url":"https://api.github.com/repos/jupyterlab/jupyterlab/deployments","created_at":"2016-06-03T20:09:17Z","updated_at":"2018-05-16T22:25:28Z","pushed_at":"2018-05-16T22:55:12Z","git_url":"git://github.com/jupyterlab/jupyterlab.git","ssh_url":"git@github.com:jupyterlab/jupyterlab.git","clone_url":"https://github.com/jupyterlab/jupyterlab.git","svn_url":"https://github.com/jupyterlab/jupyterlab","homepage":"","size":57067,"stargazers_count":5390,"watchers_count":5390,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":637,"mirror_url":null,"archived":false,"open_issues_count":814,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":637,"open_issues":814,"watchers":5390,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582"},"html":{"href":"https://github.com/jupyterlab/jupyterlab/pull/4582"},"issue":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/4582"},"comments":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/issues/4582/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/pulls/4582/commits"},"statuses":{"href":"https://api.github.com/repos/jupyterlab/jupyterlab/statuses/50e18bc2b2f50b5780f8e4934923d82f2d0e9871"}},"author_association":"NONE"}}
{"actor":{"display_login":"ian-r-rose"}}