Public buffer getChars and translateToString truncate multi-codepoint graphemes
@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
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
- 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 coder/ghostty-web
-
buffer translateToString()/getChars() return '' for empty cells, collapsing cursor-positioned textAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
coder/ghostty-web#205 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
coder/ghostty-web#204 ·
-
Alt+<printable key> sends the bare key with no ESC prefix (readline/emacs/tmux meta bindings lost)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
coder/ghostty-web#203 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
coder/ghostty-web#199 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
coder/ghostty-web#198 ·
Todos los issues de coder/ghostty-web
Issues similares
-
nextjs-tracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
cloudflare/vinext#3887 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
apache/rocketmq-dashboard#6331 ·
Los mantenedores suelen responder en 5 días
-
bug cache clinical-safety P1-critical
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
juspay/blend-design-system#1788 ·
Los mantenedores suelen responder en 1 día
-
[Analytics] Add Focus Time-Block Efficiency Ratio Calculator in src/lib/focus/efficiency-ratio.tsAbiertoanalytics beginner friendly community contributions-welcome enhancement good first issue hacktoberfest help wanted up-for-grabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día