summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGregor Herburger <[email protected]>2026-04-13 17:24:54 +0200
committerTom Rini <[email protected]>2026-04-22 14:23:49 -0600
commite973fa5115e40f93bb1425db5b1cc1f3d9b8047d (patch)
treedd802fea63d671edf6ae2bcd28d4fab68e15defa /cmd
parent2c8fdd7aea1d3c6c380ea5b5080147dc7fe9c38f (diff)
cli: flush stdin before enabling cli
Currently there is no possibility to flush stdin after autocommands are executed. If in the bootcmd the stdin is changed, e.g. from nulldev to serial, it could happen that junk characters sit in the fifo and appear on the cli. Add a option to clear stdin before starting the CLI. Signed-off-by: Gregor Herburger <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 9b8a13c3446..3fd791f3e4b 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -47,6 +47,14 @@ config HUSH_SELECTABLE
default y if HUSH_OLD_PARSER && HUSH_MODERN_PARSER
endmenu
+config CMDLINE_FLUSH_STDIN
+ bool "Enable flushing input before starting cli"
+ help
+ When this option is enabled the stdin buffer will be flushed before
+ starting the CLI. This is useful when stdin is changed during boot
+ (e.g. from nulldev to serial) and junk characters may be pending
+ in the buffer.
+
config CMDLINE_EDITING
bool "Enable command line editing"
default y