diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index b4134f1cf..6aa8909b3 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -58,6 +58,29 @@ export function Prompt(props: PromptProps) { const command = useCommandDialog() const renderer = useRenderer() + const textareaKeybindings = createMemo(() => { + const newlineBindings = keybind.all.input_newline || [] + const submitBindings = keybind.all.input_submit || [] + + return [ + { name: "return", action: "submit" }, + ...newlineBindings.map((binding) => ({ + name: binding.name, + ctrl: binding.ctrl || undefined, + meta: binding.meta || undefined, + shift: binding.shift || undefined, + action: "newline" as const, + })), + ...submitBindings.map((binding) => ({ + name: binding.name, + ctrl: binding.ctrl || undefined, + meta: binding.meta || undefined, + shift: binding.shift || undefined, + action: "submit" as const, + })), + ] + }) + const fileStyleId = syntaxTheme.getStyleId("extmark.file")! const agentStyleId = syntaxTheme.getStyleId("extmark.agent")! const pasteStyleId = syntaxTheme.getStyleId("extmark.paste")! @@ -384,7 +407,7 @@ export function Prompt(props: PromptProps) {