Skip to content

Commit ddf3d70

Browse files
committed
feat(console): add shell component with pipeline and operator support
Add new esp_shell component providing Unix-like shell functionality: - Pipeline support with '|' operator for command chaining - File output with support for '>' or '>>' for append. - Multiple command operators: ';' (continue), '&&' (break on fail), '||' (break on success) - Asynchronous command execution using console task API - Real-time I/O handling with select() for stdin/stdout/stderr - Proper resource management and error handling - Support for Ctrl+D EOF detection, will support escaping of if a program like grep Enables complex command sequences and data flow between commands similar to traditional Unix shells.
1 parent 551de8c commit ddf3d70

File tree

3 files changed

+400
-1
lines changed

3 files changed

+400
-1
lines changed

components/console/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set(srcs "commands.c"
44
"esp_console_common.c"
55
"esp_console_repl_internal.c"
66
"split_argv.c"
7-
"linenoise/linenoise.c")
7+
"linenoise/linenoise.c"
8+
"shell.c")
89

910
set(requires vfs)
1011

components/console/esp_shell.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#pragma once
7+
8+
#include <stdbool.h>
9+
10+
esp_err_t esp_shell_run(char *command_line, int *cmd_ret);

0 commit comments

Comments
 (0)