Repository navigation
fix(tmux): every tmux command runs as a UTF-8 client, so a listing parses with no locale set - #360
Closed
WynandVStaden wants to merge 1 commit into
Closed
WynandVStaden wants to merge 1 commit into
WynandVStaden wants to merge 1 commit into
Conversation
…rses with no locale set Started with no UTF-8 locale (a minimal container, a systemd unit), tmux 3.7 sanitizes its -F output and the U+001F field separator comes back as "_". Every listing line then parses to nothing, the poll throws and the bridge is marked disconnected although tmux is answering. Pass -u on every invocation, which makes the client UTF-8 regardless of LANG and LC_ALL. Both spawns now build their argv through one pure helper so a test can pin it. Fixes AltanS#358
Owner
|
Thanks @WynandVStaden, this ships in 1.17.0. Your |
AltanS
added a commit
that referenced
this pull request
Oct 6, 2026
Closes #358. Thanks @WynandVStaden. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Fixes #358.
Every tmux command the adapter runs now carries
-u, so the client is UTF-8 whatever the ambient locale is. Started with no UTF-8 locale (a bare container, a systemd unit), tmux 3.7c sanitizes-Foutput and theU+001Ffield separator comes back as_. Every listing line then parses to nothing, the poll throws, and the bridge is marked disconnected while tmux is answering.I went with the flag rather than
LC_ALL=C.UTF-8in the child environment (suggestion 1 in the issue) for two reasons: it does not need that locale to exist on the box, and it still holds when the operator's environment pinsLC_ALL=C, which outranks anyLANG. Both spawns inexec.tsnow build their argv through one pure helper,tmuxArgv, so a test can pin the line. I left the error sentence alone, since with-uthe locale can no longer be the cause.Reproduction and result
Built tmux 3.7c from source on Ubuntu 24.04 and ran the real
SpawnTmuxExec+LISTING_ARGS+parseListingagainst a server with one session, underenv -i:mainLC_ALL=CRaw tmux 3.7c output for the same format string:
S_$0_1_reprowith no locale,S^_$0^_1^_reprowith-u.Base branch — see CONTRIBUTING.md:
main— there is one line of development, andmainis itChecks
bun run typecheck(root andweb/),bun run lint,bun test ./bridge ./cli ./scripts,cd web && bun run testall passRun on Ubuntu 24.04 (WSL), bun 1.4.2: both typechecks pass, lint reports 0 warnings and 0 errors, and the backend suite is 6392 pass, 0 fail. The web suite is 17723 passed and 1 failed:
src/lib/table-run.test.ts› "claims real tables and nothing else across every committed capture". That test fails the same way on unmodifiedmainin my environment, and this PR touches nothing underweb/, so I have left the box unticked rather than claim it.CHANGELOG entry: fork PR, so no version bump and no CHANGELOG edit. A suggested line, if useful:
- **A tmux listing parses when no locale is set.** Started with no UTF-8 locale — a minimal container, a systemd unit — tmux 3.7 replaced the separator Collie reads with "_", so every poll failed and the app showed the host as down while tmux was answering. Collie now runs every tmux command with -u. Thanks @cyxou (#358).