import type { CommandDescriptor, CommandOutput } from "@core/command"; import type { CommandIO } from "@core/command_io"; import { createSuccessResult, type ResultSuccess } from "@core/result"; import type { ShellState } from "@core/shell_state"; import type { ShellError } from "@core/util/errors"; export const COMMAND_NAME = "clear"; async function main(io: CommandIO, state: ShellState, __args: string[]): Promise> { io.writeStdout(new TextEncoder().encode("\x1b[2J\x1b[0;0H")); const result: ResultSuccess = createSuccessResult(COMMAND_NAME); return { state: state, result, }; } export const descriptor: CommandDescriptor = { fn: main, name: COMMAND_NAME, };