From af9a1797b52171ec625643e2d0116d77dfa9651b Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Mon, 3 Nov 2025 20:16:04 -0500 Subject: [PATCH] tui: use keybind helper for history navigation to respect custom keybindings --- .../src/cli/cmd/tui/component/prompt/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 4078bf6f..591fecc6 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -587,8 +587,12 @@ export function Prompt(props: PromptProps) { return } - if (e.name === "up" && input.visualCursor.visualRow === 0) input.cursorOffset = 0 - if (e.name === "down" && input.visualCursor.visualRow === input.height - 1) + if (keybind.match("history_previous", e) && input.visualCursor.visualRow === 0) + input.cursorOffset = 0 + if ( + keybind.match("history_next", e) && + input.visualCursor.visualRow === input.height - 1 + ) input.cursorOffset = input.plainText.length } if (!autocomplete.visible) { @@ -712,7 +716,8 @@ export function Prompt(props: PromptProps) { {props.hint!} - {keybind.print("command_list")} commands + {keybind.print("command_list")}{" "} + commands