{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/15958","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/15958/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/15958/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/15958/events","html_url":"https://github.com/Microsoft/vscode/pull/15958","id":191269904,"number":15958,"title":"Fix focus and configuration handling of the integrated terminal","user":{"login":"kaiwood","id":7542,"avatar_url":"https://avatars.githubusercontent.com/u/7542?v=3","gravatar_id":"","url":"https://api.github.com/users/kaiwood","html_url":"https://github.com/kaiwood","followers_url":"https://api.github.com/users/kaiwood/followers","following_url":"https://api.github.com/users/kaiwood/following{/other_user}","gists_url":"https://api.github.com/users/kaiwood/gists{/gist_id}","starred_url":"https://api.github.com/users/kaiwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaiwood/subscriptions","organizations_url":"https://api.github.com/users/kaiwood/orgs","repos_url":"https://api.github.com/users/kaiwood/repos","events_url":"https://api.github.com/users/kaiwood/events{/privacy}","received_events_url":"https://api.github.com/users/kaiwood/received_events","type":"User","site_admin":false},"labels":[{"id":287229834,"url":"https://api.github.com/repos/Microsoft/vscode/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"login":"Tyriar","id":2193314,"avatar_url":"https://avatars.githubusercontent.com/u/2193314?v=3","gravatar_id":"","url":"https://api.github.com/users/Tyriar","html_url":"https://github.com/Tyriar","followers_url":"https://api.github.com/users/Tyriar/followers","following_url":"https://api.github.com/users/Tyriar/following{/other_user}","gists_url":"https://api.github.com/users/Tyriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Tyriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tyriar/subscriptions","organizations_url":"https://api.github.com/users/Tyriar/orgs","repos_url":"https://api.github.com/users/Tyriar/repos","events_url":"https://api.github.com/users/Tyriar/events{/privacy}","received_events_url":"https://api.github.com/users/Tyriar/received_events","type":"User","site_admin":false},"assignees":[{"login":"Tyriar","id":2193314,"avatar_url":"https://avatars.githubusercontent.com/u/2193314?v=3","gravatar_id":"","url":"https://api.github.com/users/Tyriar","html_url":"https://github.com/Tyriar","followers_url":"https://api.github.com/users/Tyriar/followers","following_url":"https://api.github.com/users/Tyriar/following{/other_user}","gists_url":"https://api.github.com/users/Tyriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Tyriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tyriar/subscriptions","organizations_url":"https://api.github.com/users/Tyriar/orgs","repos_url":"https://api.github.com/users/Tyriar/repos","events_url":"https://api.github.com/users/Tyriar/events{/privacy}","received_events_url":"https://api.github.com/users/Tyriar/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode/milestones/30","html_url":"https://github.com/Microsoft/vscode/milestones/November%202016","labels_url":"https://api.github.com/repos/Microsoft/vscode/milestones/30/labels","id":2029906,"number":30,"title":"November 2016","description":"","creator":{"login":"dbaeumer","id":1931590,"avatar_url":"https://avatars.githubusercontent.com/u/1931590?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaeumer","html_url":"https://github.com/dbaeumer","followers_url":"https://api.github.com/users/dbaeumer/followers","following_url":"https://api.github.com/users/dbaeumer/following{/other_user}","gists_url":"https://api.github.com/users/dbaeumer/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaeumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaeumer/subscriptions","organizations_url":"https://api.github.com/users/dbaeumer/orgs","repos_url":"https://api.github.com/users/dbaeumer/repos","events_url":"https://api.github.com/users/dbaeumer/events{/privacy}","received_events_url":"https://api.github.com/users/dbaeumer/received_events","type":"User","site_admin":false},"open_issues":185,"closed_issues":392,"state":"open","created_at":"2016-09-26T20:19:36Z","updated_at":"2016-11-30T11:58:35Z","due_on":"2016-11-30T00:00:00Z","closed_at":null},"comments":5,"created_at":"2016-11-23T13:26:30Z","updated_at":"2016-11-30T14:05:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/vscode/pulls/15958","html_url":"https://github.com/Microsoft/vscode/pull/15958","diff_url":"https://github.com/Microsoft/vscode/pull/15958.diff","patch_url":"https://github.com/Microsoft/vscode/pull/15958.patch"},"body":"This PR fixes 2 problems with the focus handling of the integrated terminal (see #15103 and #14969) .  \r\n\r\nAlthough they result in a  same usability/keybinding problem I initially described in #15103, my description was a little fuzzy because I didn't understand the cause fully. \r\n\r\nThere are currently 2 problems:\r\n\r\n---\r\n\r\n**Problem Nr. 1**\r\n\r\nWhenever a second (or third, …) terminal instance gets exited via the shell command `exit` or by pressing `ctrl-d` (which basically is \"exit\" because it sends EOF), the terminal panel loses focus and the editor gets focus.\r\n\r\nThis hinders the workflow when working with multiple terminals, because you can't close a second one without refocusing the panel again, worst case scenario would be that a user write `exit` into an editor window without being aware of it.\r\n\r\nThe only case where focus has to change is if there is only 1 instance left, in this case the panel closes itself so the user has a visual clue about whats going on.\r\n\r\nJust in case anyone asks, the reasoning I used [focus(true)](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L131) in [setActiveInstanceByIndex()](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L125) instead of inside [_removeInstance()](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L99) just in case there are some edge cases I didn't stumble upon yet. I'd guess you always want to focus your active instances, but correct me if I'm wrong.\r\n\r\n---\r\n\r\n**Problem Nr. 2**\r\n\r\nTo make the terminal work with various keyboard shortcuts, the setting `terminal.integrated.commandsToSkipShell` was introduced. The first part of my Issue I described in #15103 and I later found out to be described in #14969 as well is caused by the following:\r\n\r\nCurrently, the settings are only handled in the panel itself when [_updateCommandsToSkipShell()](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts#L263) is called (whenever the panel gets opened). If you create a new instance with either the `+`-Button in the GUI or via a shortcut, a new terminal instance get's created, gets attached – but [_skipTerminalKeybindings](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts#L122) is empty.\r\n\r\nCalling the function to skip the commands from inside [TerminalService#createInstance()](https://github.com/Microsoft/vscode/blob/19f86525f2b1fc7d87f0ad6b26c3c6524336f807/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L62) made most sense to me because it's already aware of the settings, but correct me again if I'm wrong with this assumption.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/263881098","html_url":"https://github.com/Microsoft/vscode/pull/15958#issuecomment-263881098","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/15958","id":263881098,"user":{"login":"kaiwood","id":7542,"avatar_url":"https://avatars.githubusercontent.com/u/7542?v=3","gravatar_id":"","url":"https://api.github.com/users/kaiwood","html_url":"https://github.com/kaiwood","followers_url":"https://api.github.com/users/kaiwood/followers","following_url":"https://api.github.com/users/kaiwood/following{/other_user}","gists_url":"https://api.github.com/users/kaiwood/gists{/gist_id}","starred_url":"https://api.github.com/users/kaiwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaiwood/subscriptions","organizations_url":"https://api.github.com/users/kaiwood/orgs","repos_url":"https://api.github.com/users/kaiwood/repos","events_url":"https://api.github.com/users/kaiwood/events{/privacy}","received_events_url":"https://api.github.com/users/kaiwood/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T14:05:21Z","updated_at":"2016-11-30T14:05:21Z","body":"Just noticed while looking checking for the cause of another issue that I included `TerminalService` [here](https://github.com/Microsoft/vscode/pull/15958/commits/aeaec811fe8cfd934a8946be5a6737c1041fa256#diff-8c4484557359fefa25fe7396aa970c56R172) just to use `configHelper`. Didn't notice that `_configHelper` was already available, so I removed the dependency. \r\n\r\nLast commit doesn't change any behaviour, just a cleanup. Travis was green before this, Appveyor timed out, maybe we are lucky and they get both green this time around 😆 "}}
{"actor":{"display_login":"kaiwood"}}