fix: stop emitting tabwriter escapes in create response #15

Manually merged
heiko merged 1 commit from issue-7-color-create-response into master 2026-05-17 08:31:13 +02:00
Owner

Fixes issue #7.

coloredLabelNames always wrapped ANSI in \xff markers (for
tabwriter.StripEscape). The list views flushed through a tabwriter
so this was invisible, but postIssue/postPR used plain fmt.Printf
and the bytes hit the terminal as ��.

Split into two helpers:

  • coloredLabelNames — plain ANSI (used by post* create response)
  • coloredLabelNamesTabwriter\xff-wrapped (used by list views)

New root_test.go test asserts that the first never contains \xff
and the second always does (when color is forced on).

Closes #7

ius:ai:claude-opus-4-7

Fixes issue #7. `coloredLabelNames` always wrapped ANSI in `\xff` markers (for `tabwriter.StripEscape`). The list views flushed through a tabwriter so this was invisible, but `postIssue`/`postPR` used plain `fmt.Printf` and the bytes hit the terminal as `��`. Split into two helpers: - `coloredLabelNames` — plain ANSI (used by post* create response) - `coloredLabelNamesTabwriter` — `\xff`-wrapped (used by list views) New `root_test.go` test asserts that the first never contains `\xff` and the second always does (when color is forced on). Closes #7 ius:ai:claude-opus-4-7
fix: stop emitting tabwriter \xff escapes in create response
Some checks failed
mod-nag (Push) / mod-nag (push) Has been cancelled
e98cf31786
`coloredLabelNames` wrapped each label's ANSI color codes in `\xff`
markers so `text/tabwriter` (with `StripEscape`) could treat them as
zero-width when computing column widths. The list views flushed
through a tabwriter so the markers were stripped, but `postIssue` /
`postPR` reused the same helper inside a plain `fmt.Printf`, sending
the `\xff` bytes to the terminal verbatim — rendering as `��`:

    Created issue #55 [��Kind/Bug��] releases page

Split into two helpers in `internal/cli/root.go`:

- `coloredLabelNames` — plain ANSI, no `\xff`. Used by the create
  response lines.
- `coloredLabelNamesTabwriter` — `\xff`-wrapped ANSI. Used by the
  `issue list` and `pr list` tabwriter rows.

Shared implementation behind a bool; `labelColorStyle` and
`tabwriterEscape` untouched. New test in `root_test.go` locks in the
byte-content invariant for both helpers.

Closes #7

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ius:ai:claude-opus-4-7
heiko manually merged commit 1726b620c5 into master 2026-05-17 08:31:13 +02:00
Sign in to join this conversation.
No reviewers
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!15
No description provided.