Skip to content

Commit 34179a9

Browse files
committed
add clear command
1 parent 02c310d commit 34179a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/cmd.c

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ handle_t cmd_run(guarded_t* arg) {
8989
// guarded_change(command, _(TC_Save));
9090
}
9191

92+
else if (strcmp(input, "clear\n") == 0 || (input[0] == 'C' && input[1] == '\n')) {
93+
printf("\e[1;1H\e[2J");
94+
}
95+
9296
else if (strcmp(input, "version\n") == 0 || (input[0] == 'v' && input[1] == '\n')) {
9397
printf("\n Clocker (%s)\n"\
9498
TRANSPARENT_TXT(" Copyright (C) 2021 Redwan\n"\
@@ -111,6 +115,8 @@ handle_t cmd_run(guarded_t* arg) {
111115
TRANSPARENT_TXT(ITALIC_TXT(":Consider all times from now as waste \n"))\
112116
TRANSPARENT_TXT(BOLD_TXT(" R, resume "))\
113117
TRANSPARENT_TXT(ITALIC_TXT(":Resume paused mode\n"))\
118+
TRANSPARENT_TXT(BOLD_TXT(" C, clear "))\
119+
TRANSPARENT_TXT(ITALIC_TXT(":Set console offset to the top!\n"))
114120
TRANSPARENT_TXT(BOLD_TXT(" v, version "))\
115121
TRANSPARENT_TXT(ITALIC_TXT(":Get app version \n"))\
116122
TRANSPARENT_TXT(BOLD_TXT(" E, end "))\

0 commit comments

Comments
 (0)