[PR #533] Add ALT+arrow word movement to Input component #1385

Open
opened 2026-03-14 09:33:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/533
Author: @tobwen
Created: 1/16/2026
Status: 🔄 Open

Base: mainHead: feature/alt-arrow-word-movement


📝 Commits (1)

  • 916d0ee Add ALT+arrow word movement to Input component

📊 Changes

3 files changed (+306 additions, -0 deletions)

View changed files

packages/core/src/examples/input-word-movement-demo.ts (+179 -0)
📝 packages/core/src/renderables/Input.test.ts (+86 -0)
📝 packages/core/src/renderables/Input.ts (+41 -0)

📄 Description

Implements word-by-word cursor navigation using ALT+Left and ALT+Right:

  • Adds moveCursorWordLeft and moveCursorWordRight methods
  • Includes comprehensive test cases for various scenarios
  • Creates a demo for testing and showing compatibility
  • Handles multiple spaces and partial word positions

The implementation supports both standard terminals and PuTTY's alternative input mode (see additional fix).

Hint: Different from moveWordForward/moveWordBackward which are text-direction aware (Forward goes to logical end of text). moveWordLeft/Right are visually direction aware - Left always moves cursor visually left on screen.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/533 **Author:** [@tobwen](https://github.com/tobwen) **Created:** 1/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/alt-arrow-word-movement` --- ### 📝 Commits (1) - [`916d0ee`](https://github.com/anomalyco/opentui/commit/916d0ee764fe06c62a01ddfa5a1399e6b0c2b7f0) Add ALT+arrow word movement to Input component ### 📊 Changes **3 files changed** (+306 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `packages/core/src/examples/input-word-movement-demo.ts` (+179 -0) 📝 `packages/core/src/renderables/Input.test.ts` (+86 -0) 📝 `packages/core/src/renderables/Input.ts` (+41 -0) </details> ### 📄 Description Implements word-by-word cursor navigation using ALT+Left and ALT+Right: - Adds moveCursorWordLeft and moveCursorWordRight methods - Includes comprehensive test cases for various scenarios - Creates a demo for testing and showing compatibility - Handles multiple spaces and partial word positions The implementation supports both standard terminals and PuTTY's alternative input mode (see [additional fix](https://github.com/anomalyco/opentui/pull/532)). Hint: Different from moveWordForward/moveWordBackward which are text-direction aware (Forward goes to logical end of text). moveWordLeft/Right are visually direction aware - Left always moves cursor visually left on screen. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1385
No description provided.