summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornasrlol <nsrddyn@gmail.com>2025-02-18 21:11:55 +0100
committernasrlol <nsrddyn@gmail.com>2025-02-18 21:11:55 +0100
commit9d968cbf5d718210011acc40f69a456a3b7c4836 (patch)
tree7c386ec8de703792c9b061480c68614df4fe7662
parenteb4f92268d205b6c3d61e161d4d693d16b51a554 (diff)
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 <nsrddyn@gmail.com>
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
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$ ");