{"action":"created","comment":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/99747966","pull_request_review_id":20432512,"id":99747966,"diff_hunk":"@@ -127,11 +135,33 @@ public ToolbarButton getToolbarButton()\n     */\n    public void setActiveTerminal(String caption, String handle)\n    {\n-      activeTerminalCaption_ = caption;\n       activeTerminalHandle_ = handle;\n-      toolbarButton_.setText(trimCaption(activeTerminalCaption_));\n+      String trimmed = trimCaption(caption);\n+      if (handle != null)\n+      {\n+         trimmed = addBusyIndicator(trimmed, terminals_.getHasSubprocs(handle));\n+      }\n+      toolbarButton_.setText(trimmed);\n    }\n-   \n+\n+   /**\n+    * Refresh caption of active terminal based on busy status.","path":"src/gwt/src/org/rstudio/studio/client/workbench/views/terminal/TerminalPopupMenu.java","position":61,"original_position":61,"commit_id":"555ac1c2f89eac9ba3ce4c7b53d5774ea1c48008","original_commit_id":"555ac1c2f89eac9ba3ce4c7b53d5774ea1c48008","user":{"login":"jmcphers","id":470418,"avatar_url":"https://avatars.githubusercontent.com/u/470418?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcphers","html_url":"https://github.com/jmcphers","followers_url":"https://api.github.com/users/jmcphers/followers","following_url":"https://api.github.com/users/jmcphers/following{/other_user}","gists_url":"https://api.github.com/users/jmcphers/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcphers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcphers/subscriptions","organizations_url":"https://api.github.com/users/jmcphers/orgs","repos_url":"https://api.github.com/users/jmcphers/repos","events_url":"https://api.github.com/users/jmcphers/events{/privacy}","received_events_url":"https://api.github.com/users/jmcphers/received_events","type":"User","site_admin":false},"body":"One way you can often avoid these kinds of \"refresh UX to match state\" functions is to use a `Value` wrapper around the state, and `addValueChangeHandler` to refresh the UX. This keeps you from getting into a state where the value has changed internally but isn't reflected in the UX. See: https://github.com/rstudio/rstudio/blob/master/src/gwt/src/org/rstudio/studio/client/common/Value.java\r\n\r\nNo need to rewrite this, just something to keep in the back of your head! ","created_at":"2017-02-07T05:28:37Z","updated_at":"2017-02-07T05:29:39Z","html_url":"https://github.com/rstudio/rstudio/pull/976#discussion_r99747966","pull_request_url":"https://api.github.com/repos/rstudio/rstudio/pulls/976","_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/99747966"},"html":{"href":"https://github.com/rstudio/rstudio/pull/976#discussion_r99747966"},"pull_request":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/976"}}},"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/976","id":104919863,"html_url":"https://github.com/rstudio/rstudio/pull/976","diff_url":"https://github.com/rstudio/rstudio/pull/976.diff","patch_url":"https://github.com/rstudio/rstudio/pull/976.patch","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/976","number":976,"state":"open","locked":false,"title":"Tweak and bug fix for showing busy terminals, server unit tests","user":{"login":"gtritchie","id":10569626,"avatar_url":"https://avatars.githubusercontent.com/u/10569626?v=3","gravatar_id":"","url":"https://api.github.com/users/gtritchie","html_url":"https://github.com/gtritchie","followers_url":"https://api.github.com/users/gtritchie/followers","following_url":"https://api.github.com/users/gtritchie/following{/other_user}","gists_url":"https://api.github.com/users/gtritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/gtritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtritchie/subscriptions","organizations_url":"https://api.github.com/users/gtritchie/orgs","repos_url":"https://api.github.com/users/gtritchie/repos","events_url":"https://api.github.com/users/gtritchie/events{/privacy}","received_events_url":"https://api.github.com/users/gtritchie/received_events","type":"User","site_admin":false},"body":"- Show busy terminal status on the dropdown menu button (for current terminal), not just on the dropdown. Useful for user, and helpful in noticing/fixing busy detection bugs.\r\n- Show busy by appending (busy) to the terminal caption instead of an asterisk\r\n- Fix bug where busy status getting out of sync on client because I wasn't catching message for the specific terminal instance being targeted, but by all open terminal sessions\r\n- Server-side unit tests for SessionConsoleProcessPersist and SessionConsoleProcessInfo","created_at":"2017-02-07T01:34:45Z","updated_at":"2017-02-07T05:29:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be6ffbe56eb3cc24e18e2072d50ba9de7b7e6977","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/rstudio/pulls/976/commits","review_comments_url":"https://api.github.com/repos/rstudio/rstudio/pulls/976/comments","review_comment_url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/976/comments","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/555ac1c2f89eac9ba3ce4c7b53d5774ea1c48008","head":{"label":"rstudio:feature/terminal","ref":"feature/terminal","sha":"555ac1c2f89eac9ba3ce4c7b53d5774ea1c48008","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2017-02-03T22:28:47Z","pushed_at":"2017-02-07T05:03:30Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":82598,"stargazers_count":1615,"watchers_count":1615,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":423,"mirror_url":null,"open_issues_count":8,"forks":423,"open_issues":8,"watchers":1615,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"a9e82ac47719b652b57e69197028ddafdb1a5f2d","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2017-02-03T22:28:47Z","pushed_at":"2017-02-07T05:03:30Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":82598,"stargazers_count":1615,"watchers_count":1615,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":423,"mirror_url":null,"open_issues_count":8,"forks":423,"open_issues":8,"watchers":1615,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/976"},"html":{"href":"https://github.com/rstudio/rstudio/pull/976"},"issue":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/976"},"comments":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/976/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/976/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/976/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/rstudio/statuses/555ac1c2f89eac9ba3ce4c7b53d5774ea1c48008"}}}}
{"actor":{"display_login":"jmcphers"}}