Skip to content

Commit b22cce1

Browse files
committed
refactor(terminal): update action synchronization in TerminalExecuteAction for 223
- Replace updateActionsAsync() with updateActionsImmediately() for terminal toolbar - This change ensures that the toolbar state is updated synchronously during execution state changes
1 parent 5ea09be commit b22cce1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/sketch/TerminalExecuteAction.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class TerminalExecuteAction(
4444
sketch.resultSketch.updateViewText(sketch.lastExecutionResults + "\n\n[执行已手动停止]", true)
4545
sketch.setResultStatus(TerminalExecutionState.TERMINATED)
4646

47-
sketch.toolbar.updateActionsAsync()
47+
sketch.toolbar.updateActionsImmediately()
4848
}
4949
return
5050
}
5151

5252
sketch.isExecuting = true
5353
sketch.titleLabel.icon = AllIcons.RunConfigurations.TestState.Run
5454

55-
sketch.toolbar.updateActionsAsync()
55+
sketch.toolbar.updateActionsImmediately()
5656

5757
sketch.hasExecutionResults = false
5858
sketch.lastExecutionResults = ""
@@ -95,7 +95,7 @@ class TerminalExecuteAction(
9595
sketch.titleLabel.icon = null
9696
sketch.isExecuting = false
9797

98-
sketch.toolbar.updateActionsAsync()
98+
sketch.toolbar.updateActionsImmediately()
9999

100100
val success = exitCode == 0
101101
sketch.setResultStatus(
@@ -111,7 +111,7 @@ class TerminalExecuteAction(
111111
sketch.titleLabel.icon = null
112112
sketch.isExecuting = false
113113

114-
sketch.toolbar.updateActionsAsync()
114+
sketch.toolbar.updateActionsImmediately()
115115

116116
sketch.resultSketch.updateViewText("${stdWriter.getContent()}\n错误: ${ex.message}", true)
117117
sketch.setResultStatus(TerminalExecutionState.FAILED, ex.message)

0 commit comments

Comments
 (0)