mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
terminal: fix persistent tabs - do not close tabs from confirmation listener
This commit is contained in:
@@ -9,7 +9,7 @@ import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.ui.content.Content
|
||||
|
||||
class TerminalTabCloseListener(content: Content,
|
||||
class TerminalTabCloseListener(val content: Content,
|
||||
val project: Project) : BaseContentCloseListener(content, project) {
|
||||
override fun disposeContent(content: Content) {
|
||||
}
|
||||
@@ -18,7 +18,8 @@ class TerminalTabCloseListener(content: Content,
|
||||
if (modal || ApplicationManager.getApplication().isDisposeInProgress) {
|
||||
return true
|
||||
}
|
||||
if (!TerminalView.getWidgetByContent(content).isSessionRunning) {
|
||||
val widget = TerminalView.getWidgetByContent(content)
|
||||
if (widget == null || !widget.isSessionRunning) {
|
||||
return true
|
||||
}
|
||||
val proxy = NopProcessHandler().apply { startNotify() }
|
||||
@@ -27,4 +28,8 @@ class TerminalTabCloseListener(content: Content,
|
||||
val result = TerminateRemoteProcessDialog.show(project, "Terminal ${content.displayName}", proxy)
|
||||
return result != null
|
||||
}
|
||||
|
||||
override fun canClose(project: Project): Boolean {
|
||||
return project === this.project && closeQuery(this.content, true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user