diff options
author | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-12 23:01:14 -0700 |
---|---|---|
committer | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2025-09-12 23:01:14 -0700 |
commit | d8797a1f88e23e07241a20fd9bc75c6d10f3d416 (patch) | |
tree | 32e8e115b9c311331c2151eb47e697afd35414b4 /ptyim.c | |
parent | d4fa36ec446e758a7c167cb2e9c7ce6a69678853 (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |