Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit af9a179

Browse files
thdxropencode
authored andcommitted
tui: use keybind helper for history navigation to respect custom keybindings
1 parent 29b3e40 commit af9a179

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/component/prompt

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,12 @@ export function Prompt(props: PromptProps) {
587587
return
588588
}
589589

590-
if (e.name === "up" && input.visualCursor.visualRow === 0) input.cursorOffset = 0
591-
if (e.name === "down" && input.visualCursor.visualRow === input.height - 1)
590+
if (keybind.match("history_previous", e) && input.visualCursor.visualRow === 0)
591+
input.cursorOffset = 0
592+
if (
593+
keybind.match("history_next", e) &&
594+
input.visualCursor.visualRow === input.height - 1
595+
)
592596
input.cursorOffset = input.plainText.length
593597
}
594598
if (!autocomplete.visible) {
@@ -712,7 +716,8 @@ export function Prompt(props: PromptProps) {
712716
<Match when={props.hint}>{props.hint!}</Match>
713717
<Match when={true}>
714718
<text fg={theme.text}>
715-
{keybind.print("command_list")} <span style={{ fg: theme.textMuted }}>commands</span>
719+
{keybind.print("command_list")}{" "}
720+
<span style={{ fg: theme.textMuted }}>commands</span>
716721
</text>
717722
</Match>
718723
</Switch>

0 commit comments

Comments
 (0)