Skip to content
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

Terminal doesn't always render initially when using PseudoTerminal and task custom execution #94402

Closed
GabeDeBacker opened this issue Apr 3, 2020 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues terminal Integrated terminal issues

Comments

@GabeDeBacker
Copy link
Contributor

  • VSCode Version: Version: 1.43.2 (system setup)
    Commit: 0ba0ca5
    Date: 2020-03-24T07:38:38.248Z
    Electron: 7.1.11
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0

  • OS Version:
    OS: Windows_NT x64 10.0.19600

Steps to Reproduce:
Our extension registers a custom task provider and it provides tasks with custom execution and the following presentation options:

{
            clear: true,
            focus: false,
            reveal: vscode.TaskRevealKind.Always
};

If the terminal "tab" is not already selected for some other reason (say power shell started, etc.) then when the task runs, the terminal dropdown displays the correct task name, but nothing renders.

Note that adding this simple code:

        vscode.window.onDidOpenTerminal((t) => {
            t.show();
        });

Works around this issue.

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

@vscodebot
Copy link

vscodebot bot commented Apr 3, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@Tyriar
Copy link
Member

Tyriar commented Apr 3, 2020

@alexr00 here's what the Terminal.show API calls on the renderer side:

public $show(terminalId: number, preserveFocus: boolean): void {
const terminalInstance = this._terminalService.getInstanceFromId(terminalId);
if (terminalInstance) {
this._terminalService.setActiveInstance(terminalInstance);
this._terminalService.showPanel(!preserveFocus);
}
}

What task reveal does:

const isTerminalInPanel: boolean = this.viewDescriptorService.getViewLocation(TERMINAL_VIEW_ID) === ViewContainerLocation.Panel;
if (isTerminalInPanel && this.isTaskVisible(task)) {
if (this.previousPanelId) {
if (this.previousTerminalInstance) {
this.terminalService.setActiveInstance(this.previousTerminalInstance);
}
this.panelService.openPanel(this.previousPanelId);
} else {
this.panelService.hideActivePanel();
}
this.previousPanelId = undefined;
this.previousTerminalInstance = undefined;
} else {
if (isTerminalInPanel) {
this.previousPanelId = this.panelService.getActivePanel()?.getId();
if (this.previousPanelId === TERMINAL_VIEW_ID) {
this.previousTerminalInstance = this.terminalService.getActiveInstance() ?? undefined;
}
}
this.terminalService.setActiveInstance(terminalData.terminal);
if (CustomTask.is(task) || ContributedTask.is(task)) {
this.terminalService.showPanel(task.command.presentation!.focus);
}
}

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues tasks Task system issues labels Apr 3, 2020
@GabeDeBacker
Copy link
Contributor Author

@Tyriar & @alexr00 - any update on this? Our customers are starting to notice this issue more.

@GabeDeBacker GabeDeBacker changed the title Terminal doesn't always render initially when using PseudoTerminal with and task custom execution Terminal doesn't always render initially when using PseudoTerminal and task custom execution Apr 16, 2020
@alexr00
Copy link
Member

alexr00 commented Apr 17, 2020

@GabeDeBacker I'm not able to repro this now. There were some changes in showing tasks in 1.44, do you still see the issue there?

@Tyriar
Copy link
Member

Tyriar commented Apr 17, 2020

Fixed a similar issue recently #94714

The problem there was that when an extension created a terminal and did not call show and then another terminal is shown, there were actually 2 terminal tabs visible at once, one not being drawn (the initial one) and one being draw but it was offscreen.

@alexr00
Copy link
Member

alexr00 commented Apr 17, 2020

That was probably it then. I tested in master this time so I had the fix for #94714

@alexr00
Copy link
Member

alexr00 commented Apr 17, 2020

@GabeDeBacker can you check in Insiders and see if you still have the same problem?

@GabeDeBacker
Copy link
Contributor Author

@alexr00 - Hey, sorry about not responding sooner. Checking now

@GabeDeBacker
Copy link
Contributor Author

@alexr00 - I can confirm that this is indeed addressed in the insiders version. I'm closing this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

3 participants