From d8797a1f88e23e07241a20fd9bc75c6d10f3d416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Fri, 12 Sep 2025 23:01:14 -0700 Subject: Reset cursor position on startup to fix issue with cursor being stuck outside scroll region if ptyim is launched with it at the bottom row --- ptyim.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ptyim.c') diff --git a/ptyim.c b/ptyim.c index f6434c8..329e371 100644 --- a/ptyim.c +++ b/ptyim.c @@ -81,6 +81,9 @@ void condition_stdin() { //make it raw cfmakeraw(&stdin_termio); tcsetattr(STDIN_FILENO,TCSANOW,&stdin_termio); + //move cursor to top left and clear screen + write(STDIN_FILENO,"\033[0;0f",6); + write(STDIN_FILENO,"\033[2J", 4); } void restore_stdin() { tcsetattr(STDIN_FILENO,TCSANOW,&stdin_termio_bk); -- cgit v1.1