diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-07-24 15:36:56 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-07-24 15:36:56 +0100 |
commit | 1aa7efdd7a8dcfd1a55f30c2754d1e473f0bb59b (patch) | |
tree | b1458a0bd4bfd136608cc6c7f867319fbc0a8723 /gramscii.c | |
parent | 5cfc45336702f9edb4e1c65890157e7ccdafd482 (diff) |
force flush on ANSI commands
Diffstat (limited to 'gramscii.c')
-rw-r--r-- | gramscii.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -106,6 +106,7 @@ void cleanup(int s){ printf("\033[;H\033[2J"); tcsetattr(0, TCSANOW, &t1); + fflush(stdout); exit(0); } @@ -147,6 +148,7 @@ void status_bar(){ printf(" '%d' ", screen[y][x]); #endif printf("\033[0m"); + fflush(stdout); } char get_key(char *msg){ @@ -156,6 +158,7 @@ char get_key(char *msg){ printf("\033[%d;1f\033[7m", HEIGHT+1); printf("%s", msg); printf("\033[0m"); + fflush(stdout); return getchar(); } @@ -173,6 +176,7 @@ void get_string(char *msg, char *s, int sz){ fgets(s, sz, stdin); s[strlen(s)-1] = '\0'; tcsetattr(0, TCSANOW, &t2); + fflush(stdout); } int is_yes(char c){ @@ -183,6 +187,7 @@ int is_yes(char c){ void show_cursor(){ printf("\033[%d;%df", y+1, x+1); + fflush(stdout); } void set_cur(char c){ @@ -198,11 +203,13 @@ void draw_xy(int x, int y, char c){ /* FIXME: check if x and y are valid!!!! */ printf("\033[%d;%df",y+1,x+1); putchar(c); + fflush(stdout); } void update_current(){ printf("\033[%d'%df",y+1,x+1); putchar(screen[y][x]); + fflush(stdout); } void erase_line(char *s){ @@ -360,6 +367,7 @@ int progr_y(int dir){ void set_video(int v){ printf("\033[%dm", v); + fflush(stdout); } /*** Lines and markers ***/ |