Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/tui/src/component/prompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have hardcoded the HOME and END keys, which overcorrected the PR bound as a modification keybinds. To change keybind edit tui.json

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
Expand Down
Loading