]> Sergey Matveev's repositories - st.git/commitdiff
Clear screen: Fix edge case
authorMarkus Rinne <markus.ka.rinne@gmail.com>
Mon, 25 Nov 2024 11:31:56 +0000 (13:31 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 6 Dec 2024 12:42:50 +0000 (13:42 +0100)
With sequence \e[1J, if cursor is on second line, clear the first line.

st.c

diff --git a/st.c b/st.c
index 57c6e962ac778da43795ed855035b4554ebd02cf..2e3800e437ecda60d015a16da9f468c576337bb4 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1705,7 +1705,7 @@ csihandle(void)
                        }
                        break;
                case 1: /* above */
-                       if (term.c.y > 1)
+                       if (term.c.y > 0)
                                tclearregion(0, 0, term.col-1, term.c.y-1);
                        tclearregion(0, term.c.y, term.c.x, term.c.y);
                        break;