Add clear command

This commit is contained in:
2026-08-23 13:40:20 +03:00
parent f086e1d674
commit e46f837789
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ const commands = std.StaticStringMap(CommandFn).initComptime(.{
.{ "command", @import("cmds/command.zig").execute },
.{ "run", @import("cmds/run.zig").execute },
.{ "echo", @import("cmds/echo.zig").execute },
.{ "clear", @import("cmds/clear.zig").execute },
.{ "exit", @import("cmds/exit.zig").execute },
});
+10
View File
@@ -0,0 +1,10 @@
const std = @import("std");
const types = @import("../types.zig");
pub fn execute(ctx: types.CommandContext) !void {
try ctx.stdout.writeStreamingAll(
ctx.io,
"\x1b[2J\x1b[H",
);
}