{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/76056915","id":76056915,"diff_hunk":"@@ -112,41 +158,55 @@ void SendTargentsListResponse(inspector_socket_t* socket, int port) {\n       \"  \\\"id\\\": \\\"%d\\\",\"\n       \"  \\\"title\\\": \\\"%s\\\",\"\n       \"  \\\"type\\\": \\\"node\\\",\"\n+      \"  \\\"url\\\": \\\"file://%s\\\",\"\n       \"  \\\"webSocketDebuggerUrl\\\": \\\"ws://localhost:%d%s\\\"\"\n       \"} ]\";\n-  char buffer[sizeof(LIST_RESPONSE_TEMPLATE) + 4096];\n-  char title[2048];  // uv_get_process_title trims the title if too long\n-  int err = uv_get_process_title(title, sizeof(title));\n-  if (err != 0) {\n-    snprintf(title, sizeof(title), \"Node.js\");\n-  }\n-  char* c = title;\n-  while (*c != '\\0') {\n-    if (*c < ' ' || *c == '\\\"') {\n-      *c = '_';\n+  size_t buf_len = sizeof(LIST_RESPONSE_TEMPLATE) + sizeof(DEVTOOLS_HASH) +\n+                   sizeof(DEVTOOLS_PATH) * 2 + 200 + path.length() * 2;\n+  char* buffer = new char[buf_len];\n+  size_t title_start = path.rfind('/');\n+  if (title_start == std::string::npos) {\n+    title_start = path.rfind('\\\\');\n+    if (title_start == std::string::npos) {\n+      title_start = 0;\n     }\n-    c++;\n   }\n-  size_t len = snprintf(buffer, sizeof(buffer), LIST_RESPONSE_TEMPLATE,\n+\n+  if (title_start > 0) {\n+    title_start += 1;  // Skip separator\n+  }\n+\n+  std::string title = path.substr(title_start);\n+\n+  for (size_t i = 0; i < title.length(); i++) {\n+    const char c = title[i];\n+    title[i] = (c < ' ' || c == '\\\"') ? '_' : c;","path":"src/inspector_agent.cc","position":102,"original_position":102,"commit_id":"b774dd698be7b8658fac5a6aed35de10ab648849","original_commit_id":"b774dd698be7b8658fac5a6aed35de10ab648849","user":{"login":"addaleax","id":899444,"avatar_url":"https://avatars.githubusercontent.com/u/899444?v=3","gravatar_id":"","url":"https://api.github.com/users/addaleax","html_url":"https://github.com/addaleax","followers_url":"https://api.github.com/users/addaleax/followers","following_url":"https://api.github.com/users/addaleax/following{/other_user}","gists_url":"https://api.github.com/users/addaleax/gists{/gist_id}","starred_url":"https://api.github.com/users/addaleax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addaleax/subscriptions","organizations_url":"https://api.github.com/users/addaleax/orgs","repos_url":"https://api.github.com/users/addaleax/repos","events_url":"https://api.github.com/users/addaleax/events{/privacy}","received_events_url":"https://api.github.com/users/addaleax/received_events","type":"User","site_admin":false},"body":"That would make pathnames containing non-ASCII characters unreadable, right?","created_at":"2016-08-24T13:36:52Z","updated_at":"2016-08-24T13:36:52Z","html_url":"https://github.com/nodejs/node/pull/8243#discussion_r76056915","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/8243","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/76056915"},"html":{"href":"https://github.com/nodejs/node/pull/8243#discussion_r76056915"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/8243"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/8243","id":82446035,"html_url":"https://github.com/nodejs/node/pull/8243","diff_url":"https://github.com/nodejs/node/pull/8243.diff","patch_url":"https://github.com/nodejs/node/pull/8243.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/8243","number":8243,"state":"open","locked":false,"title":"inspector - Use script name for target title","user":{"login":"eugeneo","id":287917,"avatar_url":"https://avatars.githubusercontent.com/u/287917?v=3","gravatar_id":"","url":"https://api.github.com/users/eugeneo","html_url":"https://github.com/eugeneo","followers_url":"https://api.github.com/users/eugeneo/followers","following_url":"https://api.github.com/users/eugeneo/following{/other_user}","gists_url":"https://api.github.com/users/eugeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/eugeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugeneo/subscriptions","organizations_url":"https://api.github.com/users/eugeneo/orgs","repos_url":"https://api.github.com/users/eugeneo/repos","events_url":"https://api.github.com/users/eugeneo/events{/privacy}","received_events_url":"https://api.github.com/users/eugeneo/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for your pull request. Please review below requirements.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nThis only touches JSON API of the V8 Inspector integration.\r\n\r\n##### Description of change\r\n<!-- Provide a description of the change below this comment. -->\r\n\r\nChanges inspector integration to use Node.js script file name as target\r\ntitle (reported in JSON and shown in developer tools UIs). It will also\r\nreport file:// URL for the script as some tools seem to use that field\r\nto open the script in the editor.\r\n\r\nCC: @ofrobots ","created_at":"2016-08-23T21:39:12Z","updated_at":"2016-08-24T13:36:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd1c0a0033561aa7596589bf440d24a9e7623837","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/8243/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/8243/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8243/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/b774dd698be7b8658fac5a6aed35de10ab648849","head":{"label":"eugeneo:title_url","ref":"title_url","sha":"b774dd698be7b8658fac5a6aed35de10ab648849","user":{"login":"eugeneo","id":287917,"avatar_url":"https://avatars.githubusercontent.com/u/287917?v=3","gravatar_id":"","url":"https://api.github.com/users/eugeneo","html_url":"https://github.com/eugeneo","followers_url":"https://api.github.com/users/eugeneo/followers","following_url":"https://api.github.com/users/eugeneo/following{/other_user}","gists_url":"https://api.github.com/users/eugeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/eugeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugeneo/subscriptions","organizations_url":"https://api.github.com/users/eugeneo/orgs","repos_url":"https://api.github.com/users/eugeneo/repos","events_url":"https://api.github.com/users/eugeneo/events{/privacy}","received_events_url":"https://api.github.com/users/eugeneo/received_events","type":"User","site_admin":false},"repo":{"id":54138097,"name":"node","full_name":"eugeneo/node","owner":{"login":"eugeneo","id":287917,"avatar_url":"https://avatars.githubusercontent.com/u/287917?v=3","gravatar_id":"","url":"https://api.github.com/users/eugeneo","html_url":"https://github.com/eugeneo","followers_url":"https://api.github.com/users/eugeneo/followers","following_url":"https://api.github.com/users/eugeneo/following{/other_user}","gists_url":"https://api.github.com/users/eugeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/eugeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugeneo/subscriptions","organizations_url":"https://api.github.com/users/eugeneo/orgs","repos_url":"https://api.github.com/users/eugeneo/repos","events_url":"https://api.github.com/users/eugeneo/events{/privacy}","received_events_url":"https://api.github.com/users/eugeneo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eugeneo/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/eugeneo/node","forks_url":"https://api.github.com/repos/eugeneo/node/forks","keys_url":"https://api.github.com/repos/eugeneo/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eugeneo/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eugeneo/node/teams","hooks_url":"https://api.github.com/repos/eugeneo/node/hooks","issue_events_url":"https://api.github.com/repos/eugeneo/node/issues/events{/number}","events_url":"https://api.github.com/repos/eugeneo/node/events","assignees_url":"https://api.github.com/repos/eugeneo/node/assignees{/user}","branches_url":"https://api.github.com/repos/eugeneo/node/branches{/branch}","tags_url":"https://api.github.com/repos/eugeneo/node/tags","blobs_url":"https://api.github.com/repos/eugeneo/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eugeneo/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eugeneo/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/eugeneo/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eugeneo/node/statuses/{sha}","languages_url":"https://api.github.com/repos/eugeneo/node/languages","stargazers_url":"https://api.github.com/repos/eugeneo/node/stargazers","contributors_url":"https://api.github.com/repos/eugeneo/node/contributors","subscribers_url":"https://api.github.com/repos/eugeneo/node/subscribers","subscription_url":"https://api.github.com/repos/eugeneo/node/subscription","commits_url":"https://api.github.com/repos/eugeneo/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/eugeneo/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/eugeneo/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/eugeneo/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/eugeneo/node/contents/{+path}","compare_url":"https://api.github.com/repos/eugeneo/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eugeneo/node/merges","archive_url":"https://api.github.com/repos/eugeneo/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eugeneo/node/downloads","issues_url":"https://api.github.com/repos/eugeneo/node/issues{/number}","pulls_url":"https://api.github.com/repos/eugeneo/node/pulls{/number}","milestones_url":"https://api.github.com/repos/eugeneo/node/milestones{/number}","notifications_url":"https://api.github.com/repos/eugeneo/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eugeneo/node/labels{/name}","releases_url":"https://api.github.com/repos/eugeneo/node/releases{/id}","deployments_url":"https://api.github.com/repos/eugeneo/node/deployments","created_at":"2016-03-17T17:30:32Z","updated_at":"2016-04-18T17:50:02Z","pushed_at":"2016-08-24T02:46:08Z","git_url":"git://github.com/eugeneo/node.git","ssh_url":"git@github.com:eugeneo/node.git","clone_url":"https://github.com/eugeneo/node.git","svn_url":"https://github.com/eugeneo/node","homepage":"https://nodejs.org","size":213002,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"autoroll"}},"base":{"label":"nodejs:master","ref":"master","sha":"09f861f231e6421f6f7cd8f8de4f3a05df8b204f","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2016-08-24T13:35:07Z","pushed_at":"2016-08-24T13:22:41Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":293768,"stargazers_count":26014,"watchers_count":26014,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4023,"mirror_url":null,"open_issues_count":749,"forks":4023,"open_issues":749,"watchers":26014,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/8243"},"html":{"href":"https://github.com/nodejs/node/pull/8243"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/8243"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/8243/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/8243/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/8243/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/b774dd698be7b8658fac5a6aed35de10ab648849"}}}}
{"actor":{"display_login":"addaleax"}}