💡 Verbatim escape passthrough on text
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- c, typescript
- Domain
- cli
Research direction
Start with test/text-passthrough.test.ts, then inspect the text operation in ops.ts, emit_ch at src/clayterm.c:155, and text decoding in reduce at src/clayterm.c:562. Verify that the opt-in path preserves embedded escape bytes, avoids per-run SGR wrapping, and counts only printable cells for layout.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem?
A text run can't carry pre-formatted terminal output. Every non-printable byte in the content is mapped to U+FFFD before it reaches the screen, so any embedded escape sequence is destroyed. Rendering text(ESC + "[32mgreen" + ESC + "[0m") produces �[32mgreen�[0m—the structural ESC bytes become replacement glyphs and the rest leaks through as literal characters, so the terminal never interprets the color. Captured subprocess output, a pre-styled string, or any text that already contains escapes can't pass through intact.
Describe the solution you'd like
An opt-in passthrough flag that emits the run's bytes verbatim—no U+FFFD substitution and no per-run SGR wrapper—so embedded escapes reach the terminal unchanged:
text(preStyled, { passthrough: true });
Width accounting should still count only the printable cells (ignoring the zero-width escape bytes) so layout stays correct.
Describe alternatives you've considered
Stripping escapes in JS and re-expressing them via text({ color }) loses anything we don't model (cursor moves, OSC, mixed styling) and re-implements an ANSI parser on the JS side. The point of passthrough is to hand the renderer bytes it shouldn't touch.
Additional context
Failing test case on nm/repro/text-passthrough (test · diff).
Today emit_ch maps non-printables to U+FFFD (src/clayterm.c:155) and render_text wraps each run in its own SGR; passthrough needs a flag on the text op (ops.ts) that the text decode in reduce (src/clayterm.c:562) threads to a verbatim-copy path.
- Dominant language
- TypeScript
- Stars
- 42
- Forks
- 2
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 12
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bombshell-dev/tty
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bombshell-dev/tty#61 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
bombshell-dev/tty#129 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bombshell-dev/tty#83 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bombshell-dev/tty#82 ·
All issues in bombshell-dev/tty
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100