From a0817411e9bf59cfb2e1cfb6f6e5fd6c7dc60b07 Mon Sep 17 00:00:00 2001 From: Luke Hines Date: Sat, 18 Jul 2026 14:29:54 +0100 Subject: [PATCH] Avoid redundant grid_ref in exportScrollback spacer check --- src/ghosttyvt.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ghosttyvt.cpp b/src/ghosttyvt.cpp index f863ac8..777d2c0 100644 --- a/src/ghosttyvt.cpp +++ b/src/ghosttyvt.cpp @@ -610,7 +610,10 @@ QByteArray GhosttyVt::exportScrollback(uint16_t &outCols, uint16_t &outRows) con // Skip wide character spacer cells — they have no text content // but would otherwise be exported as phantom spaces. - if (isWideCharSpacer(m_terminal, col, static_cast(row))) + // Reuse the grid ref above instead of isWideCharSpacer()'s second grid_ref. + GhosttyCell cell = 0; + if (ghostty_grid_ref_cell(&ref, &cell) == GHOSTTY_SUCCESS + && isWideSpacerCell(cell)) continue; size_t graphemeLen = 0;