Fix 'Run in terminal' button regression
Signed-off-by: Fred Bricon <fbricon@gmail.com>
This commit is contained in:
parent
28835393cf
commit
e8f2bc8ceb
1 changed files with 8 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
import { defaultBorderRadius, vscEditorBackground } from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { isJetBrains } from "../../util";
|
||||
import { isTerminalCodeBlock } from "./utils";
|
||||
import { isTerminalCodeBlock, getTerminalCommand } from "./utils";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
import { CopyIconButton } from "../gui/CopyIconButton";
|
||||
import useUIConfig from "../../hooks/useUIConfig";
|
||||
|
|
@ -88,6 +88,12 @@ export default function StepContainerPreActionButtons({
|
|||
});
|
||||
}
|
||||
|
||||
async function onClickRunTerminal(): Promise<void> {
|
||||
if (shouldRunTerminalCmd) {
|
||||
return ideMessenger.ide.runCommand(getTerminalCommand(codeBlockContent));
|
||||
}
|
||||
}
|
||||
|
||||
// Handle apply keyboard shortcut
|
||||
useWebviewListener(
|
||||
"applyCodeFromChat",
|
||||
|
|
@ -120,7 +126,7 @@ export default function StepContainerPreActionButtons({
|
|||
<HeaderButtonWithToolTip
|
||||
text="Run in terminal"
|
||||
style={{ backgroundColor: vscEditorBackground }}
|
||||
onClick={onClickApply}
|
||||
onClick={onClickRunTerminal}
|
||||
>
|
||||
<CommandLineIcon className="h-4 w-4 text-gray-400" />
|
||||
</HeaderButtonWithToolTip>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue