Skip to content

[FEATURE REQUEST] Add natural text editing on macOS - #8

Merged
Raiden-MeixElysia merged 1 commit into
ELY-Open-Source:mainfrom
totorowldox:feat/natural-text-editing
Oct 22, 2026
Merged

Raiden-MeixElysia merged 1 commit into
ELY-Open-Source:mainfrom
totorowldox:feat/natural-text-editing

Conversation

@totorowldox

@totorowldox totorowldox commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Type

  • [FEATURE REQUEST]: a new feature or an improvement

What and why

Adds a macOS-only Settings › Terminal switch, natural_text_editing, off by default. When on, Option and Command edit text the way macOS's text views do, sending bytes that bash, zsh, fish and readline already bind:

Keys Sent Effect
Option-Left / Option-Right ESC b / ESC f word back / forward
Option-Backspace / Option-Delete ESC DEL / ESC d delete word back / forward
Command-Left / Command-Right Ctrl-A / Ctrl-E line start / end
Command-Backspace / Command-Delete Ctrl-U / Ctrl-K delete to line start / end

The mapping applies whatever Option as Alt says, and before kitty's flags, since it is a compatibility choice; Shift/Ctrl variants and Command+Option pass through. Releases are consumed without sending bytes. Cmd-Up and Cmd-Down still jump between prompts.

This is the iTerm2 “Natural Text Editing” preset, opt-in. It is not on by default because it overrides the modified-arrow encodings a program may expect.

How it was tested

  • cargo test --lib natural_text_editing — the new mapping test passes.
  • On macOS, shot sent all eight combinations to /bin/sh under stty raw; od recorded 1b 62 1b 66 1b 7f 1b 64 01 05 15 0b, in that order.
  • With the switch off, Command-Left still sent 1b 5b 31 3b 39 44, the previous modified arrow.
  • Settings capture shows the new row under Option as Alt.
  • scripts/check.sh: fmt and clippy pass; 262 of 264 tests pass. The two failures are the fish and PowerShell shell tests, because fish and pwsh are not installed on this machine; CI covers them.

Checklist

  • The title starts with [FEATURE REQUEST], [BUG REPORT] or [Other]
  • Tests and the build pass locally
  • Docs are updated if behaviour changed

…by default that sends Option and Command's editing keys as readline's bytes
@Raiden-MeixElysia
Raiden-MeixElysia merged commit baf5ae7 into ELY-Open-Source:main Oct 22, 2026
@Raiden-MeixElysia

Copy link
Copy Markdown
Contributor

Thanks for the PR! Merged and shipped in v0.1.8. https://github.com/ELY-Open-Source/ELYTerminal/releases/tag/v0.1.8

Raiden-MeixElysia added a commit that referenced this pull request Oct 22, 2026
@totorowldox
totorowldox deleted the feat/natural-text-editing branch October 22, 2026 12:15
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.

2 participants