Skip to content

Conversation

@gustafeden
Copy link

Summary

Adds standard macOS Option key shortcuts for word-based text navigation and deletion:

  • Option+Backspace: Delete word backward
  • Option+Left: Move cursor one word left
  • Option+Right: Move cursor one word right

Changes

  • lib/src/keyboard/input_parser.dart: Add handling for ESC+0x7F sequence (how macOS sends Option+Backspace)
  • lib/src/components/text_field.dart:
    • Add Alt+Left/Right handlers that call _moveCursorByWord()
    • Add Alt+Backspace handler that calls _deleteWordBackward()
    • Reorder backspace handlers so modifier variants (Ctrl/Alt) are checked before plain backspace

Testing

Tested manually in a terminal UI application. All three shortcuts now work as expected on macOS.

Gustaf Eden added 2 commits January 7, 2026 12:45
- Add Alt+Backspace to delete word backward
- Add Alt+Left/Right to move cursor by word
- Fix input parser to recognize ESC+0x7F as Alt+Backspace on macOS
- Reorder backspace handlers so modifier variants are checked first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant