1# Shell configuration options 2 3# Copyright (c) 2014-2015 Wind River Systems, Inc. 4# Copyright (c) 2016 Intel Corporation 5# Copyright (c) 2018 Nordic Semiconductor ASA 6# SPDX-License-Identifier: Apache-2.0 7 8menuconfig SHELL 9 bool "Shell" 10 imply LOG_RUNTIME_FILTERING 11 select EVENTS 12 13if SHELL 14 15module = SHELL 16module-str = Shell 17source "subsys/logging/Kconfig.template.log_config" 18source "subsys/shell/backends/Kconfig.backends" 19 20config SHELL_MINIMAL 21 bool "Default config to reduce flash and memory requirements" 22 help 23 This is a meta-configuration option to significantly reduce the flash 24 and memory requirements of the shell. Enabling it will choose Kconfig 25 defaults which favor reduced flash or memory requirements over extra 26 features. 27 28config SHELL_DEVICE_HELPERS 29 bool "Shell device helpers" 30 imply DEVICE_DT_METADATA 31 default y if !SHELL_MINIMAL 32 33config SHELL_THREAD_PRIORITY_OVERRIDE 34 bool "Override default shell thread priority" 35 help 36 Option to change the default value of shell thread priority. 37 38if SHELL_THREAD_PRIORITY_OVERRIDE 39config SHELL_THREAD_PRIORITY 40 int "Shell thread priority" 41 default 0 42 help 43 Set thread priority of the shell 44endif 45 46config SHELL_STACK_SIZE 47 int "Shell thread stack size" 48 default 3168 if OPENTHREAD_SHELL 49 default 3072 if 64BIT 50 default 2048 if MULTITHREADING 51 default 0 if !MULTITHREADING 52 help 53 Stack size for thread created for each instance. 54 55config SHELL_BACKSPACE_MODE_DELETE 56 bool "Default escape code for backspace is DELETE (0x7F)" 57 default y 58 help 59 Terminals have different escape code settings for backspace button. 60 Some terminals send code: 0x08 (backspace) other 0x7F (delete). When 61 this option is set shell will expect 0x7F for backspace key. 62 63config SHELL_PROMPT_CHANGE 64 bool "Allow prompt change in runtime" 65 default y if !SHELL_MINIMAL 66 help 67 Allow for the modification of the shell prompt at runtime. 68 Enabling this will allocate additional RAM memory where 69 the string of the prompt will be stored. 70 71config SHELL_PROMPT_BUFF_SIZE 72 int "Shell prompt buffer size" 73 depends on SHELL_PROMPT_CHANGE 74 range 2 40 75 default 10 if SHELL_MINIMAL 76 default 20 77 help 78 Maximum prompt size in bytes. One byte is reserved for the string 79 terminator character. 80 81config SHELL_CMD_BUFF_SIZE 82 int "Shell command buffer size" 83 default 128 if SHELL_MINIMAL 84 default 256 85 help 86 Maximum command size in bytes. One byte is reserved for the string 87 terminator character. 88 89config SHELL_PRINTF_BUFF_SIZE 90 int "Shell print buffer size" 91 default 30 92 help 93 Maximum text buffer size for fprintf function. 94 It is working like stdio buffering in Linux systems 95 to limit number of peripheral access calls. 96 97config SHELL_PRINTF_AUTOFLUSH 98 bool "Indicate if the buffer should be automatically flushed" 99 default y 100 help 101 Specify whether the shell's printing functions should automatically 102 flush the printf buffer. 103 104config SHELL_DEFAULT_TERMINAL_WIDTH 105 int "Default terminal width" 106 range 1 $(UINT16_MAX) 107 default 80 108 help 109 Default terminal width is used to break lines. 110 111config SHELL_DEFAULT_TERMINAL_HEIGHT 112 int "Default terminal height" 113 default 24 114 115config SHELL_ARGC_MAX 116 int "Maximum arguments in shell command" 117 range 3 $(UINT8_MAX) 118 default 30 if NET_L2_WIFI_SHELL 119 default 20 120 help 121 Maximum number of arguments that can build a command. 122 123config SHELL_TAB 124 bool "The Tab button support in shell" 125 default y if !SHELL_MINIMAL 126 help 127 Enable using the Tab button in the shell. The button 128 can be used for prompting commands, or for autocompletion. 129 This feature has high impact on flash usage. 130 131config SHELL_TAB_AUTOCOMPLETION 132 bool "Commands autocompletion with the Tab button" 133 depends on SHELL_TAB 134 default y if !SHELL_MINIMAL 135 help 136 Enable commands and subcommands autocompletion with the Tab 137 key. This function can be deactivated to save some flash. 138 139config SHELL_ASCII_FILTER 140 bool "Filter incoming ASCII characters" 141 default y 142 help 143 Shell will not collect characters that are not in 144 ASCII range: <0, 127>. As a result filtered characters will not be 145 printed on the terminal and passed to the command handler. 146 147config SHELL_WILDCARD 148 bool "Wildcard support in shell" 149 select POSIX_C_LIB_EXT 150 default y if !SHELL_MINIMAL 151 help 152 Enables using wildcards: * and ? in the shell. 153 154config SHELL_MSG_CMD_NOT_FOUND 155 bool "': command not found' message in the shell" 156 default y 157 help 158 If enabled, the shell prints out this message. 159 160config SHELL_MSG_SPECIFY_SUBCOMMAND 161 bool "'Please specify a subcommand.' message in the shell" 162 default y 163 help 164 If enabled, the shell prints out this message. 165 166config SHELL_ECHO_STATUS 167 bool "Echo on shell" 168 default y 169 help 170 If enabled shell prints back every input byte. 171 172config SHELL_START_OBSCURED 173 bool "Display asterisk when echoing" 174 help 175 If enabled, don't echo actual character, but echo * instead. 176 This is used for login prompts. 177 178config SHELL_VT100_COMMANDS 179 bool "VT100 commands in shell" 180 default y 181 help 182 Enables VT100 commands in shell (e.g. cursor position, clear screen etc.). 183 184config SHELL_VT100_COLORS 185 bool "Colors in shell" 186 depends on SHELL_VT100_COMMANDS 187 default y if !SHELL_MINIMAL 188 help 189 If enabled VT100 colors are used in shell (e.g. print errors in red). 190 191config SHELL_GETOPT 192 bool "Threadsafe getopt support in shell" 193 select GETOPT 194 help 195 This config creates a separate getopt_state for the shell instance. 196 It ensures that using getopt with shell is thread safe. 197 When more threads are using sys_getopt please call sys_getopt_state_get to 198 get getopt state of the shell thread. 199 200config SHELL_METAKEYS 201 bool "Metakeys" 202 default y if !SHELL_MINIMAL 203 help 204 Enables shell meta keys: Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e, 205 Ctrl+f, Ctrl+k, Ctrl+l, Ctrl+u, Ctrl+w, Alt+b, Alt+f 206 Meta keys will not be active when shell echo is set to off. 207 208config SHELL_HELP 209 bool "Help message" 210 default y if !SHELL_MINIMAL 211 help 212 Enables shell functions for printing formatted help message. 213 214config SHELL_HELP_OPT_PARSE 215 bool "Parse -h and --help options" 216 depends on SHELL_HELP 217 depends on !SHELL_GETOPT 218 default y 219 help 220 Shell parses command to find '-h' or '--help' string. If the shell 221 finds the string, it will automatically print a help message 222 for a command. 223 224config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT 225 bool "Printing help on wrong argument count" 226 depends on SHELL_HELP 227 default y if !SHELL_MINIMAL 228 229config SHELL_HISTORY 230 bool "History in shell" 231 default y if !SHELL_MINIMAL 232 help 233 Enable commands history. History can be accessed using up and down 234 arrows or Ctrl+n and Ctrl+p meta keys. 235 236config SHELL_HISTORY_BUFFER 237 int "History buffer in bytes" 238 default 128 if SHELL_MINIMAL 239 default 512 240 depends on SHELL_HISTORY 241 help 242 Number of bytes dedicated for storing executed commands. 243 244config SHELL_STATS 245 bool "Shell statistics" 246 default y if !SHELL_MINIMAL 247 248config SHELL_CMDS 249 bool "Built-in commands" 250 default y if !SHELL_MINIMAL 251 help 252 Enable built-in commands like 'clear', 'history', etc. 253 254config SHELL_CMDS_RESIZE 255 bool "Resize command" 256 depends on SHELL_CMDS 257 depends on SHELL_VT100_COMMANDS 258 default y if !SHELL_MINIMAL 259 help 260 By default shell assumes width of a terminal screen set to 80 261 characters. Each time terminal screen width is changed resize command 262 must be called to ensure correct text display on the terminal screen. 263 The resize command can be turned off to save code memory (~0,5k). 264 265config SHELL_CMDS_SELECT 266 bool "Select command" 267 depends on SHELL_CMDS 268 help 269 This option enables select command. It can be used to set new root 270 command. Exit to main command tree is with alt+r. 271 272config SHELL_CMD_ROOT 273 string "Set a root command at init" 274 help 275 This option sets a root command at shell init, 276 and when exiting to main command tree with alt+r. 277 278config SHELL_LOG_BACKEND 279 bool "Shell log backend" 280 depends on LOG && !LOG_MODE_MINIMAL 281 select MPSC_PBUF 282 select LOG_OUTPUT 283 default y if LOG 284 help 285 When enabled, backend will use the shell for logging. 286 This option is enabled by default. 287 Disabling this option disables log output to all shell backends. 288 Disabling log output to a specific shell backend can be achieved 289 using the shell backend's LOG_LEVEL option 290 (e.g. CONFIG_SHELL_TELNET_INIT_LOG_LEVEL_NONE=y). 291 292config SHELL_LOG_BACKEND_CUSTOM 293 bool "Use custom backend implementation" 294 help 295 When enabled, standard implementation of shell log backend is not included. 296 It allows to provide custom implementation of multiplexing logging messages 297 with shell data. 298 299if SHELL_LOG_BACKEND 300 301config SHELL_LOG_OUTPUT_TIMESTAMP 302 bool "Log output timestamp" 303 default y 304 help 305 Enable timestamp in log output. 306 307config SHELL_LOG_FORMAT_TIMESTAMP 308 bool "Format timestamp" 309 default y 310 help 311 Enable timestamp formatting. 312 313config SHELL_LOG_OUTPUT_LEVEL 314 bool "Log output level" 315 default y 316 help 317 Enable log level in log output. 318 319config SHELL_LOG_OUTPUT_CRLF_NONE 320 bool "Log output CRLF none" 321 help 322 Do not modify CRLF characters in log output. 323 324config SHELL_LOG_OUTPUT_CRLF_LFONLY 325 bool "Log output CRLF LF only" 326 help 327 Convert CRLF to LF in log output. 328 329config SHELL_LOG_OUTPUT_THREAD 330 bool "Log output thread" 331 default y 332 help 333 Enable logging thread id or name 334 335config SHELL_LOG_OUTPUT_SKIP_SOURCE 336 bool "Log output skip source" 337 help 338 Skip outputting source in log output. 339 340endif # SHELL_LOG_BACKEND 341 342config SHELL_AUTOSTART 343 bool "Auto-start shell at boot" 344 default y 345 help 346 If enabled, shell will be automatically started. 347 348config SHELL_CMDS_RETURN_VALUE 349 bool "Retval command" 350 depends on SHELL_CMDS 351 default y 352 help 353 This option enables the retval command. It is used to retrieve 354 the return value from the most recently executed command. 355 356config SHELL_CUSTOM_HEADER 357 bool "Include Custom Shell Header [EXPERIMENTAL]" 358 select EXPERIMENTAL 359 help 360 When enabled, a custom application provided header, named 361 "zephyr_custom_shell.h", is included at the end of shell.h. This enables 362 extension of the shell APIs at the macro level. Please use cautiously! 363 The internal shell API may change in future releases. 364 365config SHELL_TX_TIMEOUT_MS 366 int "Shell TX timeout in milliseconds" 367 default 500 if SHELL_LOG_BACKEND 368 default 50 369 help 370 The timeout in milliseconds for the shell TX mutex. This is used to 371 prevent deadlocks when called from other than the shell's processing thread. 372 When using the shell log backend, the timeout should be longer to avoid 373 timeouts due to log processing. A value of 0 means no timeout. 374 375source "subsys/shell/modules/Kconfig" 376 377endif # SHELL 378