Change:
VSCode Version: Code - Insiders 1.15.0-insider (, 2017-08-04T17:43:56.658Z) OS Version: Darwin x64 16.7.0 After having used the terminal switcher for a few days, I realize that I'm always assuming that the keyboard focus moves when I change the active terminal, same what happens when using from the command pallet. As it doesn't I often end up doing the wrong thing, i.e. type shell commands in the open editor, etc. Steps to Reproduce: two terminals and one editor the keyboard focus in the editor to change the visible terminal typing -the editor content is being modified <!-- Launch with to check. --Reproduces without extensions: Yes

Discussion:
'use strict'; import nls = require('vs/nls'); <del> import errors = require('vs/base/common/errors'); </del> import strings = require('vs/base/common/strings'); import scorer = require('vs/base/common/scorer'); import { TPromise } from 'vs/base/common/winjs.base'; import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; <del> import { QuickOpenModel, QuickOpenEntryGroup, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; </del> <ins> import { QuickOpenModel, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; </ins> import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ContributableActionProvider } from 'vs/workbench/browser/actions'; <del> export class TerminalEntry extends QuickOpenEntryGroup { </del> <ins> export class TerminalEntry extends QuickOpenEntry { </ins> constructor( private label: string, <del> private open: () => void </del> <ins> private terminalService: ITerminalService </ins> ) { super(); }

} public getAriaLabel(): string { <del> return nls.localize('entryAriaLabel', "{0}, terminal picker", this.getLabel()); </del> <ins> return nls.localize('termEntryAriaLabel', "{0}, terminal picker", this.getLabel()); </ins> } public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { <del> return this.runOpen(context); </del> <ins> setTimeout(() => { this.terminalService.setActiveInstanceByIndex(parseInt(this.label.split(':')[0], 10) - 1); this.terminalService.showPanel(true); }, 0); return true; </ins> } return super.run(mode, context); } <ins> } </ins> <del> private runOpen(context: IEntryRunContext): boolean { setTimeout(() => { this.open(); }, 0); </del> <ins> export class CreateTerminal extends QuickOpenEntry { </ins> <del> return true; </del> <ins> constructor( private label: string, private terminalService: ITerminalService ) { super(); } public getLabel(): string { return this.label; } public getAriaLabel(): string { return nls.localize('termCreateEntryAriaLabel', "{0}, create new terminal", this.getLabel()); } public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { setTimeout(() => { const newTerminal = this.terminalService.createInstance(); this.terminalService.setActiveInstance(newTerminal); this.terminalService.showPanel(true); }, 0); return true; } return super.run(mode, context); </ins> } }

searchValue = searchValue.trim(); const normalizedSearchValueLowercase = strings.stripWildcards(searchValue).toLowerCase(); <del> const terminalEntries = this.getTerminals(); </del> <ins> const terminalEntries: QuickOpenEntry[] = this.getTerminals(); terminalEntries.push(new CreateTerminal(nls.localize("'workbench.action.terminal.newplus", "$(plus) Create New Integrated Terminal"), this.terminalService)); </ins> const entries = terminalEntries.filter(e => { if (!searchValue) {

private getTerminals(): TerminalEntry[] { const terminals = this.terminalService.getInstanceLabels(); const terminalEntries = terminals.map(terminal => { <del> return new TerminalEntry(terminal, () => { this.terminalService.showPanel(true).done(() => { this.terminalService.setActiveInstanceByIndex(parseInt(terminal.split(':')[0], 10) - 1); }, errors.onUnexpectedError); }); </del> <ins> return new TerminalEntry(terminal, this.terminalService); </ins> }); return terminalEntries; }