Skip to content

Commit ebfba49

Browse files
committed
add clear
1 parent e382ae0 commit ebfba49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/finsh/cmd.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* 2018-11-22 Jesven list_thread add smp support
3030
* 2018-12-27 Jesven Fix the problem that disable interrupt too long in list_thread
3131
* Provide protection for the "first layer of objects" when list_*
32+
* 2020-04-07 chenhui add clear
3233
*/
3334

3435
#include <rthw.h>
@@ -48,6 +49,15 @@ long hello(void)
4849
}
4950
FINSH_FUNCTION_EXPORT(hello, say hello world);
5051

52+
long clear(void)
53+
{
54+
rt_kprintf("\x1b[2J\x1b[H");
55+
56+
return 0;
57+
}
58+
FINSH_FUNCTION_EXPORT(clear,clear the terminal screen);
59+
MSH_CMD_EXPORT(clear,clear the terminal screen);
60+
5161
extern void rt_show_version(void);
5262
long version(void)
5363
{

0 commit comments

Comments
 (0)