diff --git a/README.md b/README.md index 59dd83d..158d0b5 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,22 @@ open_scrollback = "ALT+S" Each tab has its own stack of tiled and floating panes; only the active tab is rendered. A thin tab bar appears at the top when more than one tab is open. Closing the last tiled pane while floating panes exist promotes the most recently active floating pane to a tiled pane. + +## Diagnostics + +Two render-debugging flags are off by default and add no overhead unless enabled. Pass them +as JVM system properties (each also has an environment-variable equivalent). With the +packaged binary the JVM picks them up from `JDK_JAVA_OPTIONS`: + +```sh +JDK_JAVA_OPTIONS="-Djprototerm.profile=true" ./result/bin/jprototerm +``` + +- `-Djprototerm.profile=true` (or `JPROTOTERM_PROFILE=1`): print a `[render-profile]` line to + stderr every N renders with the per-frame cost of each render stage — `snapshot` (terminal + state marshalling), `fingerprint` (change detection), `draw` (canvas painting), and the + `frame-total`. Set `-Djprototerm.profile.frames=` to change the dump interval (default + 120). +- `-Djprototerm.debugRepaint=true` (or `JPROTOTERM_DEBUG_REPAINT=1`): paint each per-column + repaint run's cleared span red instead of clearing it. Repainted regions flash red, so you + can see exactly which cells are being redrawn each frame. diff --git a/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java b/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java index 3adc57f..9a18e1e 100644 --- a/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java +++ b/src/main/java/com/gregor/jprototerm/TerminalPaneNode.java @@ -44,12 +44,6 @@ final class TerminalPaneNode extends Region { private static final int DIRTY_PARTIAL = 1; private static final int DIRTY_FULL = 2; - // Debug toggle: when set, skip the per-column repaint and always repaint the whole row. - // Used to bisect partial-repaint artifacts (stale black bars near the cursor). - private static final boolean FULL_ROW_REPAINT = - 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. @@ -747,10 +741,6 @@ final class TerminalPaneNode extends Region { } private void renderChanged(RenderRow row) { - if (FULL_ROW_REPAINT) { - render(row); - return; - } double oldWidth = canvas.getWidth(); double oldHeight = canvas.getHeight(); prepareCanvas(row);