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

Public buffer getChars and translateToString truncate multi-codepoint graphemes

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

@schickling-assistant ya está trabajando en esto.

Desde el 1/10/2026.

  • #201 de @schickling-assistant — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript, wasm
Área
frontend, web-dev

Línea de trabajo

Start with Buffer.getLine(), BufferCell.getChars(), and translateToString(), then compare their scalar-cell handling with the existing viewport and scrollback grapheme accessors. Reproduce the examples with Bun 1.4.2 and verify that exported buffer text preserves each complete grapheme while retaining existing line snapshot behavior and empty wide-character spacer cells.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

[email protected] public buffer getChars() and translateToString() truncate multi-codepoint graphemes. The real WASM core retains the complete text; this report is specifically about buffer export, not visible canvas rendering or parsing.

Minimal reproduction

After bun add [email protected], run with Bun 1.4.2:

import { Ghostty, Terminal } from 'ghostty-web'
const ghostty = await Ghostty.load()
for (const input of ['ASCII', 'é', '👩‍💻', '👋🏽', '🇺🇸']) {
  const core = ghostty.createTerminal(24, 2)
  const terminal = new Terminal({ ghostty, cols: 24, rows: 2 })
  // Headless setup only: attach the real WASM core to the public buffer wrapper.
  terminal.wasmTerm = core
  core.write(input)
  const line = terminal.buffer.active.getLine(0)
  console.log({ input, buffer: line.translateToString(true),
    firstCell: line.getCell(0).getChars(), core: core.getGraphemeString(0, 0) })
  // Do not dispose these instances: teardown corruption is separately tracked in #141.
}

Expected: buffer export equals input. Actual: ASCII matches, but é becomes e, 👩‍💻 becomes 👩, 👋🏽 becomes 👋, and 🇺🇸 becomes 🇺. The low-level grapheme lookup returns complete text in every case. Reproduced on Linux x64.

Root cause / proposed fix

Buffer.getLine() only forwards scalar cells to BufferLine; BufferCell.getChars() uses String.fromCodePoint(cell.codepoint) without consulting grapheme_len or the existing viewport/scrollback grapheme accessors. translateToString() concatenates these truncated values.

Snapshot complete grapheme text alongside the scalar cells when creating a buffer line, using the appropriate viewport or scrollback lookup. This preserves existing line snapshot behavior and empty wide-character spacer cells.

Repeated open/closed issue and PR searches found no matching buffer-export report. Related but distinct: #141 tracks memory corruption when freeing terminals containing these graphemes; this is not a duplicate report for that teardown bug.

Posted on behalf of @schickling
field value
agent_identity unknown
session dev5.01a09047
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.4.4
agent_runtime OMP 18.4.4
agent_model anthropic/claude-opus-5-5
worktree dotfiles/main
tooling_profile dotfiles@7a9494a
Lenguaje dominante
TypeScript
Estrellas
2.9k
Forks
182
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 coder/ghostty-web

Todos los issues de coder/ghostty-web

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.