mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 02:41:48 +00:00
fix(tui): rely on native cursor for input
This commit is contained in:
parent
cd7c5e5606
commit
1c964ed43f
1 changed files with 5 additions and 3 deletions
|
|
@ -336,21 +336,23 @@ export function TextInput({
|
|||
active: focus && termFocus && !selected
|
||||
})
|
||||
|
||||
const nativeCursor = focus && termFocus && !selected
|
||||
|
||||
const rendered = useMemo(() => {
|
||||
if (!focus) {
|
||||
return display || dim(placeholder)
|
||||
}
|
||||
|
||||
if (!display && placeholder) {
|
||||
return invert(placeholder[0] ?? ' ') + dim(placeholder.slice(1))
|
||||
return nativeCursor ? dim(placeholder) : invert(placeholder[0] ?? ' ') + dim(placeholder.slice(1))
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
return renderWithSelection(display, selected.start, selected.end)
|
||||
}
|
||||
|
||||
return renderWithCursor(display, cur)
|
||||
}, [cur, display, focus, placeholder, selected])
|
||||
return nativeCursor ? display || ' ' : renderWithCursor(display, cur)
|
||||
}, [cur, display, focus, nativeCursor, placeholder, selected])
|
||||
|
||||
useEffect(() => {
|
||||
if (self.current) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue