diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index 0a9f103ef57c..6f7806d4e027 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -1366,11 +1366,19 @@ export function Prompt(props: PromptProps) { setCursorVersion((value) => value + 1) }} onCursorChange={() => setCursorVersion((value) => value + 1)} - onKeyDown={(e: { preventDefault(): void }) => { + onKeyDown={(e: KeyEvent) => { if (props.disabled) { e.preventDefault() return } + if (e.name === "end") { + e.preventDefault() + input.gotoBufferEnd() + } + if (e.name === "home") { + e.preventDefault() + input.cursorOffset = 0 + } }} onSubmit={() => { // IME: double-defer so the last composed character (e.g. Korean