💡 Verbatim escape passthrough on text
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- c, typescript
- Área
- cli
Línea de trabajo
Comienza con test/text-passthrough.test.ts; después inspecciona la operación de texto en ops.ts, emit_ch en src/clayterm.c:155 y la decodificación de texto en reduce en src/clayterm.c:562. Verifica que la ruta opt-in preserve los bytes de escape incrustados, evite el wrapping SGR por ejecución y cuente solo las celdas imprimibles para el layout.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 42
- Forks
- 2
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 12
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bombshell-dev/tty
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bombshell-dev/tty#61 · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bombshell-dev/tty#129 ·
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
bombshell-dev/tty#112 ·
-
enhancement high priority
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bombshell-dev/tty#83 · 2 comentarios ·
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
bombshell-dev/tty#82 ·
Todos los issues de bombshell-dev/tty
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mksglu/context-mode#1200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anthropics/claude-code#96687 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
AOSSIE-Org/DebateAI#582 · 2 comentarios ·