Skip to content

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

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

Merged
merged 2 commits into from
Mar 22, 2018
Merged

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

merged 2 commits into from
Mar 22, 2018

Conversation

usernamehw
Copy link
Contributor

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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
@usernamehw usernamehw deleted the focus_terminal branch March 22, 2018 20:56
@usernamehw
Copy link
Contributor Author

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
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?

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants