feat: word-based text navigation and deletion
Resolved 💬 2 comments Opened Apr 26, 2025 by vshuraeff Closed Aug 7, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
Feature Request: Implement Word-Based Text Navigation and Deletion
Description:
Introduce standard keyboard shortcuts using modifier keys (Alt/Option, potentially Cmd depending on platform standards) for word-level operations within text input fields. This includes moving the cursor word by word and deleting entire words at a time.
Motivation:
Currently, navigating and editing text often requires character-by-character actions, which is inefficient for larger edits. Implementing word-based shortcuts aligns with standard OS-level text editing behaviour, significantly improving editing speed and user experience.
Acceptance Criteria:
- Cursor Movement:
- Pressing
Alt/Option+Right Arrowmoves the cursor to the beginning of the next word. - Pressing
Alt/Option+Left Arrowmoves the cursor to the beginning of the current or previous word.
- Word Deletion:
- Pressing
Alt/Option+Backspacedeletes the word immediately preceding the cursor (and any preceding whitespace). - Pressing
Alt/Option+Delete(orFn+Alt/Option+Backspaceon some keyboards) deletes the word immediately following the cursor (and any following whitespace).
- Selection (Optional but Recommended):
- Combining
Shiftwith theAlt/Option+ Arrow Key combinations selects text word by word.
Usage Examples:
- Correcting a typo:
- User typed: "Hello brave neww world"
- Cursor is at the end.
- Press
Alt/Option+Left Arrowonce -> cursor moves before "world". - Press
Alt/Option+Left Arrowonce more -> cursor moves before "neww". - Press
Backspaceonce -> deletes the extra 'w'.
- Deleting a word:
- User typed: "This is some sample text"
- Cursor is after "sample ".
- Press
Alt/Option+Backspaceonce -> deletes "sample " -> "This is text".
- Replacing a word:
- User typed: "Use the blue button"
- Wants to replace "blue" with "green".
- Place cursor before "blue".
- Hold
Shift+Alt/Option, pressRight Arrowonce -> selects "blue ". - Type "green " -> replaces selection -> "Use the green button".
2 Comments
Cursor movement should work on latest version, could you double check that there are issues here or let me know if actually does work?
For word deletion, this is being improved in https://github.com/openai/codex/pull/685
Thank you for the feedback! Please try the latest version of Codex CLI to see if this issue persists. If it does, we're happy to take a look at a PR to the
codex-rs/implementation.