Fix Unicode goal launches without an inherited locale - #348
Merged
Merged
Conversation
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.
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.
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.