st
simple terminal
git clone https://9o.is/git/st.git
commit 1a671505ada741d3b9b6de0ae50d4e0a6989f5bb parent 469d93400307ffe4890d3d13fc288b44c88fe16a Author: noname <noname@inventati.org> Date: Tue, 29 Apr 2014 02:35:22 +0400 Do not save cursor in tresize. This patch fixes the bug introduced in 747d5c8214ffb7cc46772f11eff00709b24a2feb To reproduce the bug: 1. Save cursor: printf '\e[s' 2. Load cursor: printf '\e[u' 3. Resize st window. 4. Load cursor again: printf '\e[u' Diffstat:
| M | st.c | | | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/st.c b/st.c @@ -2634,6 +2634,7 @@ tresize(int col, int row) { int slide = term.c.y - row + 1; bool *bp; Line *orig; + TCursor c; if(col < 1 || row < 1) return 0; @@ -2695,6 +2696,7 @@ tresize(int col, int row) { tmoveto(term.c.x, term.c.y); /* Clearing both screens */ orig = term.line; + c = term.c; do { if(mincol < col && 0 < minrow) { tclearregion(mincol, 0, col - 1, minrow - 1); @@ -2702,10 +2704,10 @@ tresize(int col, int row) { if(0 < col && minrow < row) { tclearregion(0, minrow, col - 1, row - 1); } - tcursor(CURSOR_SAVE); tswapscreen(); tcursor(CURSOR_LOAD); } while(orig != term.line); + term.c = c; return (slide > 0); }