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

Plugin api window.activeTerminal can't get the right active terminal #6797

Closed
godlin-gh opened this issue Dec 29, 2019 · 2 comments · Fixed by #6799
Closed

Plugin api window.activeTerminal can't get the right active terminal #6797

godlin-gh opened this issue Dec 29, 2019 · 2 comments · Fixed by #6799
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help terminal issues related to the terminal

Comments

@godlin-gh
Copy link
Contributor

godlin-gh commented Dec 29, 2019

Description

I've written a vscode extension(also a theia plugin) which use the api window.activeTerminal. It works well on vscode but not on theia.

I've debugged the theia source code and found the bug here:

protected readonly onDidCreateTerminalEmitter = new Emitter<TerminalWidget>();
readonly onDidCreateTerminal: Event<TerminalWidget> = this.onDidCreateTerminalEmitter.event;
protected readonly onDidChangeCurrentTerminalEmitter = new Emitter<TerminalWidget | undefined>();
readonly onDidChangeCurrentTerminal: Event<TerminalWidget | undefined> = this.onDidCreateTerminalEmitter.event;

The onDidChangeCurrentTerminal should not be assigned this.onDidCreateTerminalEmitter.event, it shoud be this.onDidChangeCurrentTerminalEmitter.event

Reproduction Steps

  1. debug source code
  2. set breakpoint on TerminalServiceMainImpl.updateCurrentTerminal method
  3. change active terminal on theia UI, you'll find out that the breakpoint never be reached.

or you can try to write a plugin use window.activeTerminal api

OS and Theia version:
master
Diagnostics:

@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help terminal issues related to the terminal labels Dec 29, 2019
@akosyakov
Copy link
Member

@Godlinbupt please feel free to send a PR

@godlin-gh
Copy link
Contributor Author

@Godlinbupt please feel free to send a PR

OK,I will send a PR later.

godlin-gh pushed a commit to godlin-gh/theia that referenced this issue Dec 30, 2019
TerminalFrontendContribution.onDidChangeCurrentTerminal should be assigned this.onDidChangeCurrentTerminalEmitter.event

Signed-off-by: Gan Lin <ganlinbupt@163.com>
akosyakov pushed a commit that referenced this issue Dec 30, 2019
TerminalFrontendContribution.onDidChangeCurrentTerminal should be assigned this.onDidChangeCurrentTerminalEmitter.event

Signed-off-by: Gan Lin <ganlinbupt@163.com>
akosyakov pushed a commit to akosyakov/theia that referenced this issue Feb 24, 2020
TerminalFrontendContribution.onDidChangeCurrentTerminal should be assigned this.onDidChangeCurrentTerminalEmitter.event

Signed-off-by: Gan Lin <ganlinbupt@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help terminal issues related to the terminal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants