aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-27 19:32:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-27 19:32:40 -0700
commit1c4230a7bcb3f1dbf83a1fb995a938e793734710 (patch)
treef8853131f42960f6e5505f5c6bac4c46d94dc132
parent02f87f26d8c74d43c2fedd8f378a163a808e9a92 (diff)
downloadpw-1c4230a7bcb3f1dbf83a1fb995a938e793734710.tar.gz
pw-1c4230a7bcb3f1dbf83a1fb995a938e793734710.tar.bz2
pw-1c4230a7bcb3f1dbf83a1fb995a938e793734710.zip
Redraw bugfix: redraw from snapshot when suspended.
Without this, we cannot move horizontally while suspended, because the display refuses to refresh. Suspend mode means that we still refresh the display, but using the current snapshot data, rather than replacing that snapshot from the FIFO.
-rw-r--r--pw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pw.c b/pw.c
index 7f39674..96181f0 100644
--- a/pw.c
+++ b/pw.c
@@ -204,7 +204,9 @@ static void redraw(char **circbuf, int nlines, int hpos,
snapshot[i] = dsref(circbuf[i]);
}
} else {
- clrline();
+ printf("\r\033[%dA\033[J", snaplines);
+ for (int i = 0; i < snaplines; i++)
+ drawline(snapshot[i], hpos, columns);
}
drawstatus(stat, cmd);
}