From 263bcf36b71f13647969786935c6ad26b49adfbf Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Sun, 31 May 2026 22:02:41 +0200 Subject: [PATCH] add debugRepaint toggle that fills cleared spans red Diagnostic for the persistent black bars: fills each repaint run's cleared span red instead of clearing to transparent. If the bars turn red they are spans repaintColumns clears but never refills; if they stay black those pixels are never touched by the per-column repaint and the cause is elsewhere. Co-Authored-By: Claude Opus 4.8 --- .../com/gregor/jprototerm/TerminalPaneNode.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java b/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java index c6a2688..91f0743 100644 --- a/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java +++ b/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java @@ -50,6 +50,13 @@ final class TerminalPaneNode extends Region { Boolean.getBoolean("jprototerm.fullRowRepaint") || "1".equals(System.getenv("JPROTOTERM_FULL_ROW_REPAINT")); + // Debug toggle: paint each repaint run's cleared span red instead of clearing it to + // transparent. If the black bars turn red, they are spans repaintColumns clears but never + // refills; if they stay black, those pixels are never touched by repaintColumns at all. + private static final boolean DEBUG_REPAINT = + Boolean.getBoolean("jprototerm.debugRepaint") + || "1".equals(System.getenv("JPROTOTERM_DEBUG_REPAINT")); + private static final Color DEFAULT_FOREGROUND = Color.rgb(225, 229, 235); private static final Color SELECTED_BACKGROUND = Color.rgb(52, 92, 140); private static final Color PANE_BACKGROUND = Color.rgb(9, 10, 12); @@ -839,7 +846,12 @@ final class TerminalPaneNode extends Region { double x = TerminalMetrics.PADDING + startColumn * cellWidth; double width = (endColumn - startColumn + 1) * cellWidth; - gc.clearRect(x, 0.0, width, canvas.getHeight()); + if (DEBUG_REPAINT) { + gc.setFill(Color.RED); + gc.fillRect(x, 0.0, width, canvas.getHeight()); + } else { + gc.clearRect(x, 0.0, width, canvas.getHeight()); + } if (startColumn == 0) { gc.setFill(rowEdgeBackground(row, true)); gc.fillRect(0.0, 0.0, TerminalMetrics.PADDING, canvas.getHeight());