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

[JetBrains] Task should be stopped when closing terminal tab #12126

Closed
andreafalzetti opened this issue Aug 15, 2022 · 3 comments · Fixed by #15527
Closed

[JetBrains] Task should be stopped when closing terminal tab #12126

andreafalzetti opened this issue Aug 15, 2022 · 3 comments · Fixed by #15527
Labels

Comments

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Aug 15, 2022

Is your feature request related to a problem? Please describe

Closing a tab maintains the task alive. It's very confusing when the IDE disconnects temporarly and on-reconnect the tasks which have been closed, are all back.

Related discussions / links

Describe the behaviour you'd like

When the terminal tab "X" button is clicked, the task is stopped

Describe alternatives you've considered

Additional context

@felladrin
Copy link
Contributor

felladrin commented Aug 26, 2022

Currently, there's no way to detect when a terminal is closed from the Thin Client, and there's also no way to programmatically close the terminal widget on the Thin Client.

References: Internal Discussion, Issue on YouTrack.

@felladrin
Copy link
Contributor

It has been fixed on JetBrains IDEs v223 (Current EAP) [1].

It worked like a charm, but now, when we close JetBrains EAP Client (by clicking "X" button in the client window), it also considers that the terminals all terminal widgets were closed on purpose (which, in our case, causes all Gitpod Task Terminals to be terminated).

We now need to try to avoid it from happening. Possibly using AppLifecycleListener.appWillBeClosed [1] to remove this subscription from the widget terminals:

shellTerminalWidget.addListener(object : TerminalWidgetListener {
override fun allSessionsClosed(widget: TerminalWidget) {
terminalServiceFutureStub.shutdown(
TerminalOuterClass.ShutdownTerminalRequest.newBuilder()
.setAlias(supervisorTerminal.alias)
.build()
)
}
})

@felladrin
Copy link
Contributor

The issue on YouTrack has been marked as resolved, and I could notice an improvement:

If we click "X" button in the Connection Window, and then click "Disconnect", it correctly disconnects without closing the terminals.
image

But if we click "X" button in the JetBrains Client, it behaves differently, and the terminals end up closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants