Skip to content

Commit c2cf2f6

Browse files
committed
Refresh user space standard output
In the original user space output implementation, we would display several chess board in seqeunce. However, we only want to see the latest result of chess board, we use ascii escape code to refresh the stardard output every time before we plot the chess board out.
1 parent 414d7b3 commit c2cf2f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kmldrv-user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ int main(int argc, char *argv[])
133133
listen_keyboard_handler();
134134
} else if (read_attr && FD_ISSET(device_fd, &readset)) {
135135
FD_CLR(device_fd, &readset);
136+
printf("\033[H\033[J"); /* ASCII escape code to clear the screen */
136137
read(device_fd, display_buf, DRAWBUFFER_SIZE);
137138
printf("%s", display_buf);
138139
}

0 commit comments

Comments
 (0)