feat(ivrix): text-direction shortcut + ASCII quotes on Hebrew layout - #5
Conversation
The RTL/LTR control in the titlebar was the only way to flip the terminal print direction. Add a `toggleTextDirection` shortcut action, bound to Ctrl+Cmd+H by default, plus a matching View menu item. All four entrypoints (titlebar control, toolbar segmented control, menu item, shortcut) now flip through one path, `TerminalTextDirectionSettings.toggleDirection()`, instead of each site computing the next direction itself. Ctrl+Cmd+H is free of AppKit reservations and of every cmux default; Cmd+H alone is Hide Application, so the Ctrl variant does not shadow it. Per the shortcut policy the action is in `KeyboardShortcutSettings`, editable in Settings > Keyboard Shortcuts, settable as `shortcuts.bindings.toggleTextDirection` in `~/.config/cmux/cmux.json`, and documented in the shortcut docs and the cmux-settings skill reference. Localized across all 20 supported locales.
Hebrew layouts put HEBREW PUNCTUATION GERESH (U+05F3) and GERSHAYIM (U+05F4) on the apostrophe and quote keys, so `echo "hi"` typed in Hebrew arrives as `echo ״hi״` and the shell never sees a quote. Rewrite those two scalars to ASCII `'` and `"` on the way into the terminal, on both typed-text paths: the `insertText` accumulator and the `textForKeyEvent` fallback. The rewrite is gated on `keyTextAccumulator` being non-nil, so it only applies to live keystrokes — paste, dictation, and programmatic NSTextInputClient callers keep their text verbatim. `normalized` scans for the two scalars before reading UserDefaults, so ordinary typing pays one pass over a one-scalar string and nothing else. On by default, since shell quoting is the common case. Settings > Terminal > ASCII Quotes on Hebrew Layout turns it off for typing Hebrew acronyms such as צה״ל, which need the real gershayim; also settable as `terminal.hebrewAsciiQuotes` in `~/.config/cmux/cmux.json`. Localized across all 20 supported locales. Also adds the direction-toggle coverage for the shared `TerminalTextDirectionSettings.toggleDirection()` path added in the previous commit.
The titlebar RTL/LTR button's hover tooltip named only the current direction, so the new Ctrl+Cmd+H binding was undiscoverable from the control it drives. Route it through `Action.tooltip(_:)`, the same helper the sidebar, notifications, and focus-history buttons already use, so the tooltip reads "Right-to-left (⌃⌘H)" and follows a rebind.
Selection editing at a prompt no longer refuses on the sole grounds that an application owns the screen. It now requires what it actually needs: cells marked as input by OSC 133 `B`. No behavior change today. Claude Code, and every other full-screen application I know of, emits no OSC 133, so their composers are still copy-only. This makes Ivrix ready for the ones that mark, and turns the open question into an upstream ask rather than a terminal-side guess about where somebody else's input box begins.
Keeps the terminal-side half and the upstream request that unblocks it in one place, so the next person to touch selection editing can see why it stops at the composer of a full-screen application.
|
Added the selection-editing fix (option B from the investigation) to this branch. Diagnosis. Selecting text and typing over it worked at a shell prompt in both English and Hebrew, but did nothing in Claude Code. I captured Claude Code's startup bytes in a pty rather than assume: it enters the alternate screen (
Fix. Gate on the marking instead of on the screen. Deliberately not done: inferring the composer region from box-drawing characters. A misidentification issues deletes into the user's real input, which is the failure the original commit refused to risk. This is inert today. Claude Code emits no marks, so nothing changes for it until it does. Verification
Also drops a stale line from the Note this needs a GhosttyKit rebuild from the new pin before release; the tagged dogfood build still carries the old xcframework, which is harmless since the change is inert. |
…tes on a Hebrew layout
Two Ivrix typing-ergonomics changes, one commit each.
1. Toggle text direction from a keyboard shortcut
The RTL/LTR control in the titlebar was the only way to flip the terminal print direction.
toggleTextDirectionshortcut action, default Ctrl+Cmd+H, plus a View menu item.TerminalTextDirectionSettings.toggleDirection(), instead of each site computing the next direction itself.KeyboardShortcutSettings, editable in Settings > Keyboard Shortcuts, settable asshortcuts.bindings.toggleTextDirectionin~/.config/cmux/cmux.json, documented inweb/data/cmux-shortcuts.ts,web/data/cmux.schema.json, andskills/cmux-settings/references/shortcut-actions.md.2. ASCII quotes when typing on a Hebrew layout
Hebrew layouts put GERESH (U+05F3) and GERSHAYIM (U+05F4) on the apostrophe and quote keys, so
echo "hi"typed in Hebrew arrives asecho ״hi״and the shell never sees a quote.'and"on both typed-text paths: theinsertTextaccumulator and thetextForKeyEventfallback.keyTextAccumulatorbeing non-nil, so it only applies to live keystrokes. Paste, dictation, and programmaticNSTextInputClientcallers keep their text verbatim.normalizedscans for the two scalars before readingUserDefaults, so ordinary typing pays one pass over a one-scalar string and nothing else (this is the keystroke path).terminal.hebrewAsciiQuotesin~/.config/cmux/cmux.json.Verification
xcodebuild -scheme cmux -configuration Debug— BUILD SUCCEEDED.xcodebuild test -scheme cmux-unit -only-testing:cmuxTests/HebrewAsciiQuotesTests -only-testing:cmuxTests/TerminalTextDirectionToggleTests— 8 tests in 2 suites passed.swift test --filter SettingsRowAnchorResolutionand--filter SettingsSearchIndexTestsinPackages/macOS/CmuxSettingsUI— passed (104 row-path cases + 16 index tests)../scripts/lint-pbxproj-test-wiring.sh— ok (591 test files); both new Swift files are wired intoproject.pbxproj../scripts/reload.sh --tag ivrix-rtl-shortcut— succeeded.Localization audit
Changed user-facing surfaces: one shortcut label, one View menu item, one Settings row title with two subtitle variants, one cmux.json schema description, two skill reference docs.
Resources/Localizable.xcstrings: 5 new keys, each with real translations for all 20 supported locales (ar, bs, da, de, en, es, fr, it, ja, km, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant). Noneeds_reviewEnglish fallbacks. Verified additive: 625 insertions, 0 deletions.web/messages/*.json:docs.configuration.schemaDescriptions.terminal.hebrewAsciiQuotesadded to all 20 catalogs with real translations. Verified additive: 1 insertion, 0 deletions per file.web/data/cmux-shortcuts.ts: en + ja, matching that file's shape.CuratedSettingEntry+Default.swifttitles (the whole upstream table is bare English) and theskills/cmux-settings/references/*.mddocs (English-only).Notes
ivrix-prompt-selection-edit-app(Ivrix trunk, tip0808e7c0a4"release: Ivrix 1.1.2").origin/mainis the upstream cmux mirror and does not contain the RTL/LTR control at all.terminal.hebrewFontpredates this PR and is still missing from the search index androwConfigPaths; not touched here. The newterminal.hebrewAsciiQuotessetting does get both.https://claude.ai/code/session_01TPRwsvsc1t88Wg5LaJ3rXb