← Back to Pull requests

fix(terminal): preserve UTF-8 in Herdr tile clients and name probes #4222

Open
unknown opened this pull request with 472 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 30, 2026 16:20 UTC
Author

The fix applies to every view's writable tiles and observers, local and SSH, when the tile shell has no locale. Writable tmux clients can show Unicode as underscores; exact session-name probes can also change non-ASCII names before comparison. Request -u for writable attachments and the exact session-name probes, including the capture-only observer. The probes matter too: without -u, a Unicode session name becomes underscores before comparison and falls through the managed sizing/replacement path.

Keep the frozen generators intact and recognize the previous pinned generator exactly. Existing writable viewers use the established close-only-the-owned-pane and reopen step. A kept observer retains its old script, whose probes lack -u: a non-ASCII seat session name keeps its previous probe behavior until that observer is reopened. Its mirrored text is already full Unicode. Newly opened observers retain their capture behavior with UTF-8 name probes.

Fixes #4220. Thanks to Daniel Svennberg (@dansv59) for the diagnosis and proposed -u fix.

Validation:

  • Canonical lint passed, including daemon, UI, CLI and TUI typechecks. The expanded 27-file caller inventory verifies 716 unique cases: 715 passed at normal limits, with the unchanged watcher covered by the diagnostic below. Test wrappers account for global -u before the subcommand. The remote quoting test records the flag and exact session names, including a Unicode name, through both POSIX shell boundaries; its previously empty capture came from a shim that ignored -u. A control removing the rewrites makes the corrected test fail. All four final #4220 cases fail against the pre-fix production code and pass with the fix.

  • Real tmux 3.6 and Herdr 0.9.5, with LANG/LC_ALL/LC_CTYPE absent: pre-fix client_utf8=0 and degraded text; corrected client_utf8=1 and complete box drawing, arrows, bullets and non-ASCII text in Herdr's visible pane output. Eight native cases cover all writable attach branches, both replacement loops, Unicode session/socket targeting, observer capture with no client, and pin/giveback. Production viewer lookup and explicit reopen also checked. All eight generated native commands remain byte-identical after the frozen-module rename.

  • The provider file passed all 54 tests using a CLI-only 120-second diagnostic limit. Its existing watcher test hit its checked-in 20-second limit on both baseline and candidate on the one-CPU runner; no checked-in timeout changed.
  • The four CodeQL annotations identified JavaScript template escapes used to produce literal shell parameter expansions. Two ordinary quoted strings remove those escapes while emitting identical bytes; the rewrite search strings remain unchanged. Hosted CodeQL on the new head remains to be checked.

    Built on the existing attach/capture paths and exact-generator kept-view checks; checked the tmux 3.6 and 3.8 manuals for -u semantics. macOS CI and independent review are pending.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Improved Unicode text support in writable and read-only terminal tiles, including sessions with Unicode names.
    Improved compatibility with older terminal views. Attachments can follow managed session replacements, preserve window sizing across attachment changes, and stop when the managed session identity changes.
    Tests
    * Expanded coverage for Unicode output, older terminal views, and terminal attachment behavior, including session replacement and window-size restoration.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 472 lines (+354 / -118) across 5 files Reviewer: openrig-review Review duration: 240m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 472 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.368
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #4222"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.4% · Safe to merge
    24.4%