Uh oh!
There was an error while loading. Please reload this page.
fix: Home and End keys not working - #33554
Conversation
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Found 2 potentially related PRs:
These PRs appear to be addressing the same or very similar issues with Home/End key handling in the TUI prompt. You may want to review them to ensure there's no overlapping work or to check if this is a regression of previously fixed behavior. |
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
Pull request overview
Fixes Home/End key behavior in the TUI session prompt by decoupling navigation keybinds (Home/End) from the always-available jump chords (Ctrl+G / Ctrl+Alt+G), so cursor movement works while typing and transcript navigation still works when unfocused.
Changes:
- Split “first/last message” navigation into separate command IDs for chord bindings vs Home/End bindings.
- Add an “unfocused-only” keybinding layer for Home/End navigation when no editor is focused.
- Minor typing/cleanup adjustments in the session route.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Adds a new top-of-file HTML heading block (currently malformed/unrelated to the project README). |
| packages/tui/src/routes/session/index.tsx | Introduces new session.first_home / session.last_home commands and binds them only when no editor is focused. |
| packages/tui/src/config/keybind.ts | Splits messages_first/messages_last bindings into chord-only plus Home/End-specific command IDs mapped to new session commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes#29053
Type of change
What does this PR do?
Fix
home/endkeys stopped moving the text cursor while typing in the promptRoot cause: the keys were coupled into one command each:
gather(layer, commandIds)returns a command's entire key-set, so there was no way to guardhome/endwhile keepingctrl+g/ctrl+alt+galways-on.Fix: split each into two IDs. Chords stay always-on;
home/endmove to a layer enabled only when no editor is focused (enabled: () => currentFocusedEditor === null).The chords still work mid-typing because they aren't claimed by the managed-textarea input layer (only
input.*keys likehome,ctrl+a,ctrl+eare).If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
Type-checked both files (0 errors). No existing tests reference these command IDs. The TUI test suite won't run in my environment (@opentui/solid/preload not installed —
pre-existing/environmental), so I have not verified the behavior in the live TUI; that should be confirmed by someone with the renderer set up.
Screenshots / recordings
Home and End keys Not fixed
home-end-keys-not-fixed.mp4
Home and End keys fixed
home-end-keys-fixed.mp4
If this is a UI change, please include a screenshot or recording.
None
Checklist
If you do not follow this template your PR will be automatically rejected.