c2cb60f613
Shell history module reworked to use ring buffer for storing commands. Dedicated buffer is used to story all command lineary. History capacity is in bytes not in number of entries, e.g. many short commands can be stored or few long (depending on CONFIG_SHELL_HISTORY_BUFFER). Removed implicit command null termination from shell_history and added it to shell after fetching command line from the history. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
159 lines
3.9 KiB
Plaintext
159 lines
3.9 KiB
Plaintext
# Kconfig - Shell configuration options
|
|
|
|
#
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
|
# Copyright (c) 2016 Intel Corporation
|
|
# Copyright (c) 2018 Nordic Semiconductor ASA
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
menuconfig SHELL
|
|
bool "Shell"
|
|
imply LOG_RUNTIME_FILTERING
|
|
select POLL
|
|
|
|
if SHELL
|
|
|
|
module = SHELL
|
|
module-str = Shell
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
source "subsys/shell/Kconfig.backends"
|
|
|
|
config SHELL_STACK_SIZE
|
|
int "Shell thread stack size"
|
|
default 2048 if MULTITHREADING
|
|
default 0 if !MULTITHREADING
|
|
help
|
|
Stack size for thread created for each instance.
|
|
|
|
config SHELL_BACKSPACE_MODE_DELETE
|
|
bool "Default escape code for backspace is DELETE (0x7F)"
|
|
default y
|
|
help
|
|
Terminals have different escape code settings for backspace button.
|
|
Some terminals send code: 0x08 (backspace) other 0x7F (delete). When
|
|
this option is set shell will expect 0x7F for backspace key.
|
|
|
|
config SHELL_CMD_BUFF_SIZE
|
|
int "Shell command buffer size"
|
|
default 256
|
|
help
|
|
Maximum command size in bytes. One byte is reserved for the string
|
|
terminator character.
|
|
|
|
config SHELL_PRINTF_BUFF_SIZE
|
|
int "Shell print buffer size"
|
|
default 30
|
|
help
|
|
Maximum text buffer size for fprintf function.
|
|
It is working like stdio buffering in Linux systems
|
|
to limit number of peripheral access calls.
|
|
|
|
config SHELL_ARGC_MAX
|
|
int "Maximum arguments in shell command"
|
|
default 12
|
|
help
|
|
Maximum number of arguments that can build a command.
|
|
If command is composed of more than defined, argument SHELL_ARGC_MAX
|
|
and following are passed as one argument in the string.
|
|
|
|
config SHELL_WILDCARD
|
|
bool "Enable wildcard support in shell"
|
|
select FNMATCH
|
|
default y
|
|
help
|
|
Enables using wildcards: * and ? in the shell.
|
|
|
|
config SHELL_ECHO_STATUS
|
|
bool "Enable echo on shell"
|
|
default y
|
|
help
|
|
If enabled shell prints back every input byte.
|
|
|
|
config SHELL_VT100_COLORS
|
|
bool "Enable colors in shell"
|
|
default y
|
|
help
|
|
If enabled VT100 colors are used in shell (e.g. print errors in red).
|
|
|
|
config SHELL_METAKEYS
|
|
bool "Enable metakeys"
|
|
default y
|
|
help
|
|
Enables shell meta keys: Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e,
|
|
Ctrl+f, Ctrl+k, Ctrl+l, Ctrl+u, Ctrl+w, Alt+b, Alt+f
|
|
Meta keys will not be active when shell echo is set to off.
|
|
|
|
config SHELL_HELP
|
|
bool "Enable help message"
|
|
default y
|
|
help
|
|
Enables formatting help message when requested with '-h' or '--help'.
|
|
|
|
config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT
|
|
bool "Enable printing help on wrong argument count"
|
|
depends on SHELL_HELP
|
|
default y
|
|
|
|
config SHELL_HISTORY
|
|
bool "Enable history in shell"
|
|
default y
|
|
select RING_BUFFER
|
|
help
|
|
Enable commands history. History can be accessed using up and down
|
|
arrows.
|
|
|
|
if SHELL_HISTORY
|
|
|
|
config SHELL_HISTORY_BUFFER
|
|
int "History buffer in bytes"
|
|
default 512
|
|
help
|
|
Number of bytes dedicated for storing executed commands.
|
|
|
|
endif #SHELL_HISTORY
|
|
|
|
config SHELL_MAX_LOG_MSG_BUFFERED
|
|
int "Maximal number of log messages in FIFO"
|
|
default 8
|
|
help
|
|
When amount of buffered log messages exceeds this threshold oldest
|
|
messages are discarded.
|
|
|
|
config SHELL_STATS
|
|
bool "Enable shell statistics"
|
|
default y
|
|
|
|
config SHELL_CMDS
|
|
bool "Enable built-in commands"
|
|
default y
|
|
help
|
|
Enable built-in commands like 'clear', 'history', etc.
|
|
|
|
config SHELL_CMDS_RESIZE
|
|
bool "Enable resize command"
|
|
depends on SHELL_CMDS
|
|
default y
|
|
help
|
|
By default shell assumes width of a terminal screen set to 80
|
|
characters. Each time terminal screen width is changed resize command
|
|
must be called to ensure correct text display on the terminal screen.
|
|
The resize command can be turned off to save code memory (~0,5k).
|
|
|
|
config SHELL_CMDS_SELECT
|
|
bool "Enable select command"
|
|
depends on SHELL_CMDS
|
|
help
|
|
This option enables select command. It can be used to set new root
|
|
command. Exit to main command tree is with alt+r.
|
|
|
|
config SHELL_LOG_BACKEND
|
|
bool
|
|
default y if LOG
|
|
default n if !LOG
|
|
|
|
source "subsys/shell/modules/Kconfig"
|
|
|
|
endif # SHELL
|