Files
slimbootloader/BootloaderCommonPkg/Library/ShellLib/CmdCls.c
T
Maurice Ma 76e03f7d32 Add Shell CLS command to clear screen
This patch added "CLS" command support to SBL Shell. It can be used
to clear the console screen.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-15 15:50:06 -07:00

59 lines
1002 B
C

/** @file
Shell command `cls` to clear the console.
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/ShellLib.h>
/**
Clear console for shell.
@param[in] Shell shell instance
@param[in] Argc number of command line arguments
@param[in] Argv command line arguments
@retval EFI_SUCCESS
**/
STATIC
EFI_STATUS
EFIAPI
ShellCommandClsFunc (
IN SHELL *Shell,
IN UINTN Argc,
IN CHAR16 *Argv[]
);
CONST SHELL_COMMAND ShellCommandCls = {
L"cls",
L"Clear console",
&ShellCommandClsFunc
};
/**
Clear console for shell.
@param[in] Shell shell instance
@param[in] Argc number of command line arguments
@param[in] Argv command line arguments
@retval EFI_SUCCESS
**/
STATIC
EFI_STATUS
EFIAPI
ShellCommandClsFunc (
IN SHELL *Shell,
IN UINTN Argc,
IN CHAR16 *Argv[]
)
{
ShellPrint (L"\x1b[2J");
return EFI_SUCCESS;
}