From 9d968cbf5d718210011acc40f69a456a3b7c4836 Mon Sep 17 00:00:00 2001 From: nasrlol Date: Tue, 18 Feb 2025 21:11:55 +0100 Subject: started working on the change directory command, and im still reading the documentation about how I should approach this, also made a clear command, found how to do this in the clear man pages, what I did was pretty simple, just using the clear terminal screen text sequence and clear scroll buffer text sequence Signed-off-by: nasrlol --- main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.c b/main.c index 07bc1a1..17e0469 100644 --- a/main.c +++ b/main.c @@ -62,6 +62,20 @@ struct com_struct split_command(char *input) { return NEW_COMMAND; } +void clear() { + // clear the visible part of the terminal -> see man pages clear command + printf("\033[2J"); + // clear the input buffer of the terminal -> see man pages clear command + printf("\033[3J"); +} + +void change_directory(const char *path) { + if (path == NULL) { + printf("No path found\n"); + return; + } +} + int main(void) { while (1) { printf("\n$ "); -- cgit v1.2.3-70-g09d2