summaryrefslogtreecommitdiff
path: root/ptyim.c
diff options
context:
space:
mode:
authorHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-12 23:01:14 -0700
committerHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2025-09-12 23:01:14 -0700
commitd8797a1f88e23e07241a20fd9bc75c6d10f3d416 (patch)
tree32e8e115b9c311331c2151eb47e697afd35414b4 /ptyim.c
parentd4fa36ec446e758a7c167cb2e9c7ce6a69678853 (diff)
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
Diffstat (limited to 'ptyim.c')
-rw-r--r--ptyim.c3
1 files changed, 3 insertions, 0 deletions
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);