mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #344] [MERGED] fix: Ctrl+A/E navigate to line start/end instead of buffer #468
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#468
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/344
Author: @remorses
Created: 11/25/2025
Status: ✅ Merged
Merged: 11/26/2025
Merged by: @kommander
Base:
main← Head:fix/ctrl-a-e-line-navigation📝 Commits (3)
91ace0efix: Ctrl+A/E navigate to line start/end instead of buffer90cf4dafeat: Home/End keys navigate to buffer start/end with selection support7d1602dfix: use uppercase key names in Home/End tests📊 Changes
2 files changed (+120 additions, -14 deletions)
View changed files
📝
packages/core/src/renderables/Textarea.ts(+18 -8)📝
packages/core/src/renderables/__tests__/Textarea.editing.test.ts(+102 -6)📄 Description
The default keybindings for
Ctrl+AandCtrl+EinTextareaRenderablewere incorrectly mapped tobuffer-homeandbuffer-end(jumping to the start/end of the entire textarea). This PR changes them toline-homeandline-endto match standard Emacs/readline behavior used in virtually all Unix shells and TUI applications.This is the standard behavior:
Ctrl+A→ beginning of current lineCtrl+E→ end of current lineThis fix also resolves unexpected behavior on macOS terminals. Many terminal emulators (including Ghostty, iTerm2, Terminal.app, and Zed's integrated terminal) translate
Cmd+LeftandCmd+RightintoCtrl+AandCtrl+Erespectively. This is because macOS GUI applications useCmd+Left/Rightfor line navigation, so terminals map these to the equivalent Unix keybindings. With the previous incorrect mapping, pressingCmd+Leftwould unexpectedly jump to the start of the entire textarea instead of just the current line.Tested on both Ghostty and Zed terminal on macOS.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.