Skip to content

TaskPresentationOptions.focus = false is not honored when the terminal is revealed #124667

@matklad

Description

@matklad

Does this issue occur when all extensions are disabled?: Yes/No

Version: 1.55.2
Commit: 3c4e3df
Date: 2021-04-13T09:37:02.931Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 5.10.32

In rust-analyzer, we are are creating a Task with focus = false in the presentation. However, the terminal window is still focused if the terminal gets revealed. I would expect that the combination of reveal always and focus false results in the editor always keeping focus, even if the terminal needs to be shown in the UI. Here's a video of the wrong behavior.

focus.mp4

Note how the first run of the task steals the focus, but subsequent runs are ok, unless the terminal is closed.

Here's the relevant code from rust-analyzer:

https://github.com/rust-analyzer/rust-analyzer/blob/249e22b3250a6e35d53064decb60b67b42a75f42/editors/code/src/run.ts#L146-L149

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)bugIssue identified by VS Code Team member as probable bugterminalGeneral terminal issues that don't fall under another labelworkbench-viewsWorkbench view issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions