terminal: use session.commandManager.sendCommandToExecute instead of session.sendCommandToExecute

It is a misleading shortcut now, when command isn't sent to the process immediately.

GitOrigin-RevId: 1e9b571d8980ec22eed8255ce73d7292c6a05e00
This commit is contained in:
Sergey Simonchik
2023-12-09 23:48:04 +00:00
committed by intellij-monorepo-bot
parent 4fec3cbead
commit 2e5cc82959
4 changed files with 4 additions and 8 deletions
@@ -60,7 +60,7 @@ class BlockTerminalController(
promptVisibilityAlarm.addRequest(Runnable {
promptController.promptIsVisible = false
}, 50)
session.sendCommandToExecute(command)
session.commandManager.sendCommandToExecute(command)
session.model.isCommandRunning = true
}
@@ -79,10 +79,6 @@ class BlockTerminalSession(settings: JBTerminalSystemSettingsProviderBase,
TerminalUtil.addItem(terminationListeners, onTerminated, parentDisposable)
}
fun sendCommandToExecute(shellCommand: String) {
commandManager.sendCommandToExecute(shellCommand)
}
fun postResize(newSize: TermSize) {
terminalStarterFuture.thenAccept {
if (it != null && (newSize.columns != model.width || newSize.rows != model.height)) {
@@ -62,7 +62,7 @@ class PlainTerminalView(
}
override fun sendCommandToExecute(shellCommand: String) {
session.sendCommandToExecute(shellCommand)
session.commandManager.sendCommandToExecute(shellCommand)
}
override fun dispose() {}
@@ -99,7 +99,7 @@ class BlockTerminalTest(private val shellPath: String) {
}
withTimeout(20.seconds) { generatorCommandSent.await() }
delay((1..50).random().milliseconds) // wait a little to start generator
session.sendCommandToExecute("echo foo")
session.sendCommandToExecuteWithoutAddingToHistory("echo foo")
val env: ShellEnvironment? = withTimeout(20.seconds) { envListDeferred.await() }
Assert.assertTrue(env != null && env.envs.isNotEmpty())
assertCommandResult(0, "foo\n", outputFuture)
@@ -176,7 +176,7 @@ class BlockTerminalTest(private val shellPath: String) {
TerminalSessionTestUtil.startBlockTerminalSession(projectRule.project, shellPath, disposableRule.disposable, termSize)
private fun BlockTerminalSession.sendCommandToExecuteWithoutAddingToHistory(shellCommand: String) {
this.sendCommandToExecute(" $shellCommand")
this.commandManager.sendCommandToExecute(" $shellCommand")
}
@Suppress("SameParameterValue")