shell: add obscured input mode

Add flag to shell_flags to control echo as obscure
character (for passwords) or not. Add setter and getter
functions. Modify shell echo to use this flag if set.

Also add public setter for color mode and obscure mode.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
This commit is contained in:
Pete Skeggs 2021-03-04 11:28:05 -08:00 committed by Anas Nashif
commit c36fc5c3f2
5 changed files with 78 additions and 2 deletions

View file

@ -103,6 +103,13 @@ config SHELL_ECHO_STATUS
help
If enabled shell prints back every input byte.
config SHELL_START_OBSCURED
bool "Display asterisk when echoing"
default n
help
If enabled, don't echo actual character, but echo * instead.
This is used for login prompts.
config SHELL_VT100_COLORS
bool "Enable colors in shell"
default y if !SHELL_MINIMAL