1 // SPDX-License-Identifier: GPL-2.0+
6 * cls - clear screen command
11 #include <video_console.h>
15 static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc,
18 __maybe_unused struct udevice *dev;
21 * Send clear screen and home
24 * through an API and only be written to serial terminals, not video
27 printf(CSI "2J" CSI "1;1H");
28 if (IS_ENABLED(CONFIG_VIDEO_ANSI))
31 if (IS_ENABLED(CONFIG_VIDEO)) {
32 if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
33 return CMD_RET_FAILURE;
34 if (vidconsole_clear_and_reset(dev))
35 return CMD_RET_FAILURE;
38 return CMD_RET_SUCCESS;
41 U_BOOT_CMD(cls, 1, 1, do_video_clear, "clear screen", "");