@devries-cameron20 / t3code-1 / commits / b9bc03869e
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): terminal decorations stay visible under the block cursor (#37206)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: GPT 6.1 Sol <codex@openai.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Wout Stiens committed Nov 15, 2026 at 21:50 UTC b9bc03869e0f5dd84fb25ae1c9aaa67050a5868f
2 files changed +38 -11
apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalCanvasView.kt
+8 -3
@@ -230,9 +230,7 @@ internal class TerminalCanvasView(context: Context) : View(context) {
230 if (text.isNotEmpty() && flags and FLAG_INVISIBLE == 0) {
231 configureTextPaint(flags, currentFrame.cellForegrounds[index])
232 canvas.drawText(text, left, top + baselineOffsetPx, paint)
233 - if (flags and FLAG_OVERLINE != 0) {
234 - canvas.drawRect(left, top + 1f, right, top + max(2f, density), paint)
235 - }
233 + drawOverline(canvas, flags, left, top, right)
234 }
235 }
236 }
@@ -335,11 +333,18 @@ internal class TerminalCanvasView(context: Context) : View(context) {
333 if (text.isNotEmpty() && flags and FLAG_INVISIBLE == 0) {
334 configureTextPaint(flags, currentFrame.background)
335 canvas.drawText(text, left, top + baselineOffsetPx, paint)
336 + drawOverline(canvas, flags, left, top, right)
337 }
338 }
339 }
340 }
341
342 + private fun drawOverline(canvas: Canvas, flags: Int, left: Float, top: Float, right: Float) {
343 + if (flags and FLAG_OVERLINE != 0) {
344 + canvas.drawRect(left, top + 1f, right, top + max(2f, density), paint)
345 + }
346 + }
347 +
348 private fun columnAt(px: Float): Int {
349 val cols = frame?.cols ?: return 0
350 return ((px - contentPadding) / cellWidthPx).toInt().coerceIn(0, max(cols - 1, 0))
apps/web/src/terminal/ghostty/renderer.ts
+30 -8
@@ -149,6 +149,23 @@ function fillGhosttyRunText(
149 }
150 }
151
152 +// Draws in the current fill style, so a block cursor can redraw them in its text colour.
153 +function fillCellDecorations(
154 + context: CanvasRenderingContext2D,
155 + cell: GhosttyCell,
156 + underline: boolean,
157 + left: number,
158 + top: number,
159 + width: number,
160 + metrics: GhosttyCellMetrics,
161 +): void {
162 + if (underline) context.fillRect(left, top + metrics.height - 2, width, 1);
163 + if (cell.strikethrough) {
164 + context.fillRect(left, top + Math.floor(metrics.height * 0.55), width, 1);
165 + }
166 + if (cell.overline) context.fillRect(left, top + 1, width, 1);
167 +}
168 +
169 function fontForCell(cell: GhosttyCell, fontSize: number, fontFamily: string): string {
170 const style = cell.italic ? "italic" : "normal";
171 const weight = cell.bold ? "700" : "400";
@@ -354,13 +371,15 @@ export function renderGhosttySnapshot(options: {
371 if (!cell.underline && !cell.strikethrough && !cell.overline && !hoveredLink) continue;
372 context.fillStyle = cssColor(cell.foreground);
373 const left = padding + column * metrics.width;
357 - if (cell.underline || hoveredLink) {
358 - context.fillRect(left, top + metrics.height - 2, metrics.width, 1);
359 - }
360 - if (cell.strikethrough) {
361 - context.fillRect(left, top + Math.floor(metrics.height * 0.55), metrics.width, 1);
362 - }
363 - if (cell.overline) context.fillRect(left, top + 1, metrics.width, 1);
374 + fillCellDecorations(
375 + context,
376 + cell,
377 + cell.underline || hoveredLink,
378 + left,
379 + top,
380 + metrics.width,
381 + metrics,
382 + );
383 }
384 }
385
@@ -382,8 +401,8 @@ export function renderGhosttySnapshot(options: {
401 } else {
402 const cell = cells[snapshot.cursorX];
403 context.fillRect(left, top, width, height);
404 + context.fillStyle = cssColor(snapshot.background);
405 if (cell?.text && !cell.invisible) {
386 - context.fillStyle = cssColor(snapshot.background);
406 if (isSolidPowerlineSeparator(cell.text)) {
407 fillSolidPowerlineSeparator(context, cell.text, left, top, metrics.width, height, 0);
408 } else {
@@ -398,6 +417,9 @@ export function renderGhosttySnapshot(options: {
417 context.textAlign = "start";
418 }
419 }
420 + if (cell && !cell.invisible) {
421 + fillCellDecorations(context, cell, cell.underline, left, top, width, metrics);
422 + }
423 }
424 }
425 }