Skip to content

Fix Unicode goal launches without an inherited locale - #348

Merged
scgopi merged 1 commit into
mainfrom
fix/344-unicode-launch
Sep 13, 2026
Merged

scgopi merged 1 commit into
mainfrom
fix/344-unicode-launch

Conversation

@scgopi

@scgopi scgopi commented Sep 13, 2026

Copy link
Copy Markdown
Owner

When graphcoded inherits no locale from launchd, Unicode in a goal can be consumed as shell editing keystrokes before the backend starts. Default an absent or empty LANG to UTF-8 in the PTY environment, before zmx starts its receiving shell. Existing locale settings and per-call environment overrides retain precedence.

Closes #344.

Validation Result
Full macOS app suite 1,753 tests in 185 suites passed; xcodebuild exit 0 and TEST SUCCEEDED
SwiftPM CLI and daemon build Passed
Unicode end-to-end probe 5/5 locale cases passed for goal argv and node send
Unmodified main control (18929a9) Same probe fails with no locale: recorder never starts
SwiftLint 0 errors; 193 warnings
Swift formatting and git diff --check Passed

To reproduce on macOS from this branch:

swift build --scratch-path .spm
python3 scripts/unicode-launch-probe.py \
  .spm/debug/graphcode .spm/debug/graphcoded \
  "$HOME/.graphcode/bin/zmx"

Use the path to your installed zmx if it lives in a different support workspace. The probe runs the real CLI, isolated daemon, and zmx with temporary HOME, shell configuration, socket directory, and graph state. A fake Claude executable records argv and terminal input without making model requests. It checks en/em dashes, an arrow, emoji, a combining accent, and Japanese text under missing/empty LANG and explicit UTF-8 locale settings; all five cases should print PASS. Evidence directories are printed and retained; the daemon and its session are stopped.

Coverage is new local PTY sessions. Existing sessions, SSH hosts, and real Claude TUI/model behavior were not exercised. Explicit non-UTF-8 locale settings are preserved. Linux uses C.UTF-8 but was not tested here.

@scgopi
scgopi merged commit 235146a into main Sep 13, 2026
1 check passed
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.

Non-ASCII in a goal is eaten at launch: typed command hits ZLE with no UTF-8 locale (en dash drops the preceding word)

1 participant