CE add cls command
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m32s

This commit is contained in:
2026-03-09 18:06:45 +01:00
parent 1ef028f919
commit 814c849462

View File

@@ -17,7 +17,9 @@
#include <str_status.h> #include <str_status.h>
#include <string.h> #include <string.h>
#include <system.h> #include <system.h>
#include <tcursor.h>
#include <terminal.h> #include <terminal.h>
#include <tscreen.h>
static bool run = true; static bool run = true;
@@ -268,6 +270,8 @@ static void quit1 (struct context* context) {
interp_shutdown (); interp_shutdown ();
} }
static void cls (struct context* context) { cprintf (context, ANSIQ_CUR_HOME ANSIQ_SCR_CLR_ALL); }
static void help (struct context* context) { static void help (struct context* context) {
cprintf (context, "Available commands:\n"); cprintf (context, "Available commands:\n");
cprintf (context, "help\n"); cprintf (context, "help\n");
@@ -279,6 +283,7 @@ static void help (struct context* context) {
cprintf (context, "rm <path>\n"); cprintf (context, "rm <path>\n");
cprintf (context, "edit <path>\n"); cprintf (context, "edit <path>\n");
cprintf (context, "terminfo\n"); cprintf (context, "terminfo\n");
cprintf (context, "cls\n");
cprintf (context, "quit\n"); cprintf (context, "quit\n");
} }
@@ -317,6 +322,8 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
edit (context, cmd->args[0]); edit (context, cmd->args[0]);
} else if (strcmp (cmd->name, "terminfo") == 0) { } else if (strcmp (cmd->name, "terminfo") == 0) {
terminfo (context); terminfo (context);
} else if (strcmp (cmd->name, "cls") == 0) {
cls (context);
} else { } else {
char volume[VOLUME_MAX]; char volume[VOLUME_MAX];
const char* path; const char* path;