From c8aece4f7cb604f9462446dbfaeff202ce22a6e7 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 21 Sep 2025 02:55:01 -0400 Subject: [PATCH] sync --- packages/opencode/src/cli/cmd/opentui/session.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/opencode/src/cli/cmd/opentui/session.tsx b/packages/opencode/src/cli/cmd/opentui/session.tsx index da10fce03..962393ab9 100644 --- a/packages/opencode/src/cli/cmd/opentui/session.tsx +++ b/packages/opencode/src/cli/cmd/opentui/session.tsx @@ -26,6 +26,7 @@ import type { PatchTool } from "../../../tool/patch" import type { WebFetchTool } from "../../../tool/webfetch" import type { TaskTool } from "../../../tool/task" import { useKeyboard, type BoxProps, type JSX } from "@opentui/solid" +import { useSDK } from "./context/sdk" export function Session() { const route = useRouteData("session") @@ -36,10 +37,17 @@ export function Session() { let scroll: ScrollBoxRenderable createEffect(() => sync.session.sync(route.sessionID)) + const sdk = useSDK() useKeyboard((evt) => { if (evt.name === "pageup") scroll.scrollBy(-scroll.height / 2) if (evt.name === "pagedown") scroll.scrollBy(scroll.height / 2) + if (evt.name === "escape") + sdk.session.abort({ + path: { + id: route.sessionID, + }, + }) }) return (