Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

💡 Verbatim escape passthrough on text

Abierto
#66 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

enhancement

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bombshell-dev/tty

Todos los issues de bombshell-dev/tty

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.