apro:尝试优化linux下刷新显示问题。
This commit is contained in:
parent
59a560ff53
commit
732d503396
@ -411,6 +411,8 @@ void set_cursor_x(short x)
|
|||||||
}
|
}
|
||||||
#elif defined(OS_UNIX)
|
#elif defined(OS_UNIX)
|
||||||
printf("\033[%d;%dH", get_cursor_y(), x);
|
printf("\033[%d;%dH", get_cursor_y(), x);
|
||||||
|
fc_enable_cur();
|
||||||
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
fc_unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
||||||
@ -574,7 +576,8 @@ char* fc_readline()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
set_cursor_x(cur_pos + 1 + header_len);
|
auto ccc = cur_pos + 1 + header_len;
|
||||||
|
set_cursor_x(ccc);
|
||||||
};
|
};
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -831,9 +834,7 @@ void color_print(const char* text, const COLOR_TYPE color)
|
|||||||
} else {
|
} else {
|
||||||
printf("%s", text);
|
printf("%s", text);
|
||||||
}
|
}
|
||||||
// Resets the text to default color
|
fc_disable_cur();
|
||||||
printf("\033[0m");
|
|
||||||
fflush(stdout);
|
|
||||||
#endif
|
#endif
|
||||||
fc_unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user