hermes - 💡(How to fix) Fix HOME/END should navigate to start/end of visual line on wrapped input, with Ctrl modifier for logical boundaries [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In the TUI TextInput, pressing <Home> moves cursor to position 0 (start of the entire input) and <End> to v.length (end of the entire input). For a single long prompt that wraps across multiple terminal lines, this ignores the visual line the cursor is on.

Root Cause

In the TUI TextInput, pressing <Home> moves cursor to position 0 (start of the entire input) and <End> to v.length (end of the entire input). For a single long prompt that wraps across multiple terminal lines, this ignores the visual line the cursor is on.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

In the TUI TextInput, pressing <Home> moves cursor to position 0 (start of the entire input) and <End> to v.length (end of the entire input). For a single long prompt that wraps across multiple terminal lines, this ignores the visual line the cursor is on.

Expected Behavior

  • First <Home>: snap cursor to start of the current visual line (the line as it appears on screen)
  • Second <Home> (press again): snap to logical start (position 0)
  • First <End>: snap cursor to end of the current visual line
  • Second <End> (press again): snap to logical end (v.length)
  • Ctrl+Home: always go to logical start (absolute position 0)
  • Ctrl+End: always go to logical end (absolute v.length)

Technical Notes

The infrastructure already exists:

  • cursorLayout() in ui-tui/src/lib/inputMetrics.ts computes the current visual line given terminal width
  • visualLines() returns start/end boundaries of each visual line
  • The fix lives in ui-tui/src/components/textInput.tsx (~lines 796-808 currently)

A similar approach is used by GNU Readline and most modern TUIs (e.g., Textual, Bubble Tea).

Related

  • #18228 (Shift+Enter newline)
  • #18394 (backspace on newlines)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix HOME/END should navigate to start/end of visual line on wrapped input, with Ctrl modifier for logical boundaries [1 pull requests]