New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus terminal after toggling via `workbench.action.terminal.toggleTerminal` #46272

Merged
merged 2 commits into from Mar 22, 2018

Conversation

Projects
None yet
2 participants
@usernamehw
Copy link
Contributor

usernamehw commented Mar 21, 2018

Partly mitigates #40416 (only for the command). 2 items left:

  • First mouse click on terminal label does not focus the terminal
  • Focus not preserved for terminal after window reload

This is not a WIP, I am only interested in the command fix, as of now.

cc @Tyriar

const toDispose = this.terminalService.onInstanceProcessIdReady(() => {
this.terminalService.getActiveInstance().focus();
toDispose.dispose();
});
this.terminalService.createInstance(undefined, true);

This comment has been minimized.

@Tyriar

Tyriar Mar 22, 2018

Member

I think it would be safer to keep a reference to the ITerminalInstance created here and make sure that it's correct before you focus/dispose the listener

@Tyriar Tyriar added this to the March 2018 milestone Mar 22, 2018

@Tyriar Tyriar self-assigned this Mar 22, 2018

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Mar 22, 2018

@usernamehw works great 👍

Focus not preserved for terminal after window reload

This is as designed, the editor is always focused even if you had any panel/viewlet focused.

@Tyriar Tyriar merged commit 15ee956 into Microsoft:master Mar 22, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.

@usernamehw usernamehw deleted the usernamehw:focus_terminal branch Mar 22, 2018

@usernamehw

This comment has been minimized.

Copy link
Contributor

usernamehw commented Mar 24, 2018

This is as designed, the editor is always focused even if you had any panel/viewlet focused.

Looks like extensions viewlet is somehow an exception...

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Mar 24, 2018

@usernamehw I think this might actually be a bug, focus is sent to the extension viewlet even when it didn't have focus before. @joaomoreno?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment