From ace0dc3de9fb4b194e9fa8122ad3982aeef8c0d1 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 10 Jul 2024 23:47:41 +0200 Subject: [PATCH] Clear terminal command --- Makefile | 1 + user/clear.c | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 user/clear.c diff --git a/Makefile b/Makefile index f3cabf5..5a2e111 100644 --- a/Makefile +++ b/Makefile @@ -132,6 +132,7 @@ UPROGS=\ $U/_grind\ $U/_wc\ $U/_zombie\ + $U/_clear\ fs.img: mkfs/mkfs README $(UPROGS) mkfs/mkfs fs.img README $(UPROGS) diff --git a/user/clear.c b/user/clear.c new file mode 100644 index 0000000..d1e4e37 --- /dev/null +++ b/user/clear.c @@ -0,0 +1,11 @@ +#include "kernel/types.h" +#include "kernel/stat.h" +#include "user/user.h" + +int +main(void) +{ + write(1, "\e[1;1H\e[2J", 12); + + exit(0); +}