color in issue create response #7

Closed
opened 2026-05-17 00:27:23 +02:00 by heiko · 1 comment
Owner

The response after creating a bug somehow gets misinterpreted:

reated issue #55 [��Kind/Bug��] releases pag
The response after creating a bug somehow gets misinterpreted: ``` reated issue #55 [��Kind/Bug��] releases pag ```
Author
Owner

Plan

\xff bytes leaking through. coloredLabelNames in internal/cli/root.go
wraps each label's ANSI color codes inside \xff markers so
text/tabwriter (with StripEscape) can treat them as zero-width while
computing column widths. The two list views (issueListRun, prListRun)
use a tabwriter so the escapes get stripped on flush. The
postIssue/postPR confirmation lines use plain fmt.Printf — the
\xff bytes hit the terminal verbatim and render as ��.

Fix: split into two helpers.

  • coloredLabelNames(labels) → plain ANSI, no \xff. For fmt.Printf.
  • coloredLabelNamesTabwriter(labels)\xff-wrapped ANSI. For tabwriter.

Internally one shared implementation gated by a bool.

Call sites:

  • issue.go:151 (issueListRun), pr.go:141 (prListRun) → switch to coloredLabelNamesTabwriter.
  • issue.go:315 (postIssue), pr.go:323 (postPR) → keep coloredLabelNames (now plain).

Branch: issue-7-color-create-response. Closes #7.


ius:ai:claude-opus-4-7

## Plan `\xff` bytes leaking through. `coloredLabelNames` in `internal/cli/root.go` wraps each label's ANSI color codes inside `\xff` markers so `text/tabwriter` (with `StripEscape`) can treat them as zero-width while computing column widths. The two list views (`issueListRun`, `prListRun`) use a tabwriter so the escapes get stripped on flush. The `postIssue`/`postPR` confirmation lines use plain `fmt.Printf` — the `\xff` bytes hit the terminal verbatim and render as `��`. **Fix**: split into two helpers. - `coloredLabelNames(labels)` → plain ANSI, no `\xff`. For `fmt.Printf`. - `coloredLabelNamesTabwriter(labels)` → `\xff`-wrapped ANSI. For tabwriter. Internally one shared implementation gated by a bool. **Call sites**: - `issue.go:151` (issueListRun), `pr.go:141` (prListRun) → switch to `coloredLabelNamesTabwriter`. - `issue.go:315` (postIssue), `pr.go:323` (postPR) → keep `coloredLabelNames` (now plain). Branch: `issue-7-color-create-response`. Closes #7. --- ius:ai:claude-opus-4-7
heiko closed this issue 2026-05-17 08:31:13 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
heiko/fj#7
No description provided.