summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-03-20 14:17:32 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-03-20 14:17:32 -0700
commit00616a58eaebc8840b73c3745a70e6b5f6fac77d (patch)
tree7b3d36ac4b3dbce2bd97a3520c791d4a7bcdd4b2
parentad900636080477eb2c8df7a225a71825e5380d3d (diff)
changed clear_screen() so that it works properly within a restricted shell
-rw-r--r--src/console.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/console.c b/src/console.c
index e675ba2..400a7f5 100644
--- a/src/console.c
+++ b/src/console.c
@@ -93,7 +93,10 @@ vector_t user_input_pos() {
return pos;
}
void clear_screen() {
- system("@cls||clear");
+ /* clear the screen */
+ printf("\033[2J");
+ /* move the cursor to the top left */
+ printf("\033[0;0H");
}
void warn_user(char* message) {
clear_screen();