docs/2026 05 18 korean input followup#14
Merged
Conversation
dancinlife
commented
May 18, 2026
Contributor
- docs(sessions): 2026-05-18 Korean-input continuation — Decision 2 (chr→from_char_code)
- fix(harness-cli): modifyOtherKeys leak on exit — explicit Pn=0 + flush
- fix(harness-cli) + tape(forbidden): remove modifyOtherKeys push entirely — AGENTS.tape @f f8
…r→from_char_code) Append follow-up to the 2026-05-18 session log: - Decision 1 (modifyOtherKeys Lv2→Lv1 + hexa-lang ceiling widening) shipped earlier on this branch (commits 0cfe555 + hexa-lang bf943479); confirmed insufficient — Ghostty user reported Korean still broken. - tmux raw UTF-8 reproduce showed bug: 안→H, 녕→U (low-byte truncation). - Root: `chr(cp)` lowers to `hexa_chr_byte` (1 byte, `cp & 0xFF`) per RFC chr-byte-vs- codepoint-asymmetry (2026-05-17). Codepoint→UTF-8 belongs to `from_char_code`. - Decision 2: option-B-canonical-upstream — swap `chr(cp)` for `from_char_code(cp)` in the two decoder paths upstream in hexa-lang (compile-tree only; interpreter polled out of scope per user direction). - hexa-lang fix landed on `fix/input-decoder-chr-vs-from_char_code` branch (commit ac72668c, off origin/main). Wilson `~/core/hexa-lang` working tree mirrors the fix so local rebuilds keep working. - Verified end-to-end via tmux + Ghostty: `❯ 안녕 하세요 🌌` renders correctly. - wilson test 23/23 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Symptom (user-reported on Ghostty, 2026-05-18): After typing `/exit` in wilson and getting `bye.`, back in zsh the user typed Shift+Enter and the screen showed `;2;13~;2;13~;2;13~;2;13~`. That's the body of `ESC[27;2;13~` (xterm modifyOtherKeys Shift+Enter encoding) leaking through — wilson failed to disable modifyOtherKeys before exit, so Ghostty kept reformatting every modified keypress and zsh ate only the CSI prefix. Two root causes in `harness_cli_term_modes_off`: 1. Wilson sent `ESC[>4m` (parameterless) — per xterm spec this is "reset to default", but Ghostty (and likely other terminals) interpret a missing Pn as "no change" and modifyOtherKeys stays on. Switched to `ESC[>4;0m` (explicit DISABLE) — unambiguous "off" everywhere. 2. After `term_modes_off`, wilson printed `bye.` and returned without any flush guarantee. `eprintln + process exit` can race the terminal on macOS — the disable bytes can still sit in stdio when wilson dies. Added `render_flush()` at the end of `term_modes_off` so the pop sequences definitely leave wilson before any exit path returns. verify: wilson test 23/23 PASS. (Interactive verification: launch wilson in Ghostty → `/exit` → back at zsh → Shift+Enter should now behave normally, no `;2;13~` leak.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ely — AGENTS.tape @f f8 After the chr→from_char_code root-cause fix (Decision 2), revisited the question "do we even need modifyOtherKeys?". Answer: no — Shift+Enter has two cleaner cover paths that don't require terminal mode state: (1) ESC+CR — claude-code's terminalSetup convention. iTerm2 / VS Code / Cursor / Windsurf install shift+enter → `\x1b\r` out of the box; Ghostty needs one config line `keybind=shift+enter=text:\x1b\r`. Decoded in self/tui/input.hexa::_decode_one (ESC + 13/10 branch). (3) `\` + Enter — portable in-buffer fallback. Works on every terminal with zero config; already implemented at harness-cli main.hexa:602-608. Cost of removal: zero functionality (above paths cover Shift+Enter). Benefit: eliminates an entire class of bugs that ate 2026-05-18 debugging — - Lv2 reformatted non-ASCII printables (Hangul/CJK dropped at ASCII ceiling) - chr-byte-truncation in codepoint→UTF-8 emit (안→H, 녕→U) - on-exit pop-with-Pn-omitted stuck-mode leak (`;2;13~` leaking into zsh) All three trace back to "we push ESC[>4;Nm at TUI entry". Don't push, no class. Changes: - plugins/harness-cli/main.hexa::harness_cli_term_modes_on — push line commented out with full history block explaining why + how Shift+Enter still works. - plugins/harness-cli/main.hexa::harness_cli_term_modes_off — defensive pop (`ESC[>4;0m`) RETAINED as 1-shot cleanup for sessions inheriting a stuck mode from a pre-2026-05-18 wilson build. Idempotent; no negative effect when no push has happened. - AGENTS.tape @f f8 xterm-modifyOtherKeys-push — governance forbidden pattern, deny:write. Exception clause preserves the modifyOtherKeys *decoder* in hexa-lang (harmless when no one pushes; useful if a future feature opts back in deliberately with proper hygiene). - docs/sessions/2026-05-18-korean-input-modifyotherkeys-fix.md — Decision 3 appended (option-A-remove-modifyotherkeys-surface, 4 rationale bullets + execution log + day-summary of all three decisions). verify: wilson build OK · wilson test 23/23 PASS · interactive verification pending (user-side: launch wilson in Ghostty → /exit → Shift+Enter in zsh should now behave normally, no `;2;13~` leak even on first launch of new wilson). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.