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 POLL
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_THREAD_PRIORITY_OVERRIDE
29	bool "Override default shell thread priority"
30	help
31	  Option to change the default value of shell thread priority.
32
33if SHELL_THREAD_PRIORITY_OVERRIDE
34config SHELL_THREAD_PRIORITY
35	int "Shell thread priority"
36	default 0
37	help
38	  Set thread priority of the shell
39endif
40
41config SHELL_STACK_SIZE
42	int "Shell thread stack size"
43	default 3168 if OPENTHREAD_SHELL
44	default 3072 if 64BIT
45	default 2048 if MULTITHREADING
46	default 0 if !MULTITHREADING
47	help
48	  Stack size for thread created for each instance.
49
50config SHELL_BACKSPACE_MODE_DELETE
51	bool "Default escape code for backspace is DELETE (0x7F)"
52	default y
53	help
54	  Terminals have different escape code settings for backspace button.
55	  Some terminals send code: 0x08 (backspace) other 0x7F (delete). When
56	  this option is set shell will expect 0x7F for backspace key.
57
58config SHELL_PROMPT_CHANGE
59	bool "Allow prompt change in runtime"
60	default y if !SHELL_MINIMAL
61	help
62	  Allow for the modification of the shell prompt at runtime.
63	  Enabling this will allocate additional RAM memory where
64	  the string of the prompt will be stored.
65
66config SHELL_PROMPT_BUFF_SIZE
67	int "Shell prompt buffer size"
68	depends on SHELL_PROMPT_CHANGE
69	range 2 40
70	default 10 if SHELL_MINIMAL
71	default 20
72	help
73	  Maximum prompt size in bytes. One byte is reserved for the string
74	  terminator character.
75
76config SHELL_CMD_BUFF_SIZE
77	int "Shell command buffer size"
78	default 128 if SHELL_MINIMAL
79	default 256
80	help
81	  Maximum command size in bytes. One byte is reserved for the string
82	  terminator character.
83
84config SHELL_PRINTF_BUFF_SIZE
85	int "Shell print buffer size"
86	default 30
87	help
88	  Maximum text buffer size for fprintf function.
89	  It is working like stdio buffering in Linux systems
90	  to limit number of peripheral access calls.
91
92config SHELL_DEFAULT_TERMINAL_WIDTH
93	int "Default terminal width"
94	default 80
95	help
96	  Default terminal width is used to break lines.
97
98config SHELL_DEFAULT_TERMINAL_HEIGHT
99	int "Default terminal height"
100	default 24
101
102config SHELL_ARGC_MAX
103	int "Maximum arguments in shell command"
104	range 3 $(UINT8_MAX)
105	default 20
106	help
107	  Maximum number of arguments that can build a command.
108
109config SHELL_TAB
110	bool "The Tab button support in shell"
111	default y if !SHELL_MINIMAL && !SHELL_BACKEND_RTT
112	help
113	  Enable using the Tab button in the shell. The button
114	  can be used for prompting commands, or for autocompletion.
115	  This feature has high impact on flash usage.
116
117config SHELL_TAB_AUTOCOMPLETION
118	bool "Commands autocompletion with the Tab button"
119	depends on SHELL_TAB
120	default y if !SHELL_MINIMAL
121	help
122	  Enable commands and subcommands autocompletion with the Tab
123	  key. This function can be deactivated to save some flash.
124
125config SHELL_ASCII_FILTER
126	bool "Filter incoming ASCII characters"
127	default y
128	help
129	  Shell will not collect characters that are not in
130	  ASCII range: <0, 127>. As a result filtered characters will not be
131	  printed on the terminal and passed to the command handler.
132
133config SHELL_WILDCARD
134	bool "Wildcard support in shell"
135	select POSIX_C_LIB_EXT
136	default y if !SHELL_MINIMAL
137	help
138	  Enables using wildcards: * and ? in the shell.
139
140config SHELL_MSG_CMD_NOT_FOUND
141	bool "': command not found' message in the shell"
142	default y
143	help
144	  If enabled, the shell prints out this message.
145
146config SHELL_MSG_SPECIFY_SUBCOMMAND
147	bool "'Please specify a subcommand.' message in the shell"
148	default y
149	help
150	  If enabled, the shell prints out this message.
151
152config SHELL_ECHO_STATUS
153	bool "Echo on shell"
154	default y
155	help
156	  If enabled shell prints back every input byte.
157
158config SHELL_START_OBSCURED
159	bool "Display asterisk when echoing"
160	help
161	  If enabled, don't echo actual character, but echo * instead.
162	  This is used for login prompts.
163
164config SHELL_VT100_COMMANDS
165	bool "VT100 commands in shell"
166	default y if !SHELL_BACKEND_RTT
167	help
168	  Enables VT100 commands in shell (e.g. cursor position, clear screen etc.).
169
170config SHELL_VT100_COLORS
171	bool "Colors in shell"
172	depends on SHELL_VT100_COMMANDS
173	default y if !SHELL_MINIMAL
174	help
175	  If enabled VT100 colors are used in shell (e.g. print errors in red).
176
177config SHELL_GETOPT
178	bool "Threadsafe getopt support in shell"
179	select POSIX_C_LIB_EXT
180	help
181	  This config creates a separate getopt_state for the shell instance.
182	  It ensures that using getopt with shell is thread safe.
183	  When more threads are using getopt please call getopt_state_get to
184	  get getopt state of the shell thread.
185
186config SHELL_METAKEYS
187	bool "Metakeys"
188	default y if !SHELL_MINIMAL
189	help
190	  Enables shell meta keys: Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e,
191	  Ctrl+f, Ctrl+k, Ctrl+l, Ctrl+u, Ctrl+w, Alt+b, Alt+f
192	  Meta keys will not be active when shell echo is set to off.
193
194config SHELL_HELP
195	bool "Help message"
196	default y if !SHELL_MINIMAL
197	help
198	  Enables shell functions for printing formatted help message.
199
200config SHELL_HELP_OPT_PARSE
201	bool "Parse -h and --help options"
202	depends on SHELL_HELP
203	depends on !SHELL_GETOPT
204	default y
205	help
206	  Shell parses command to find '-h' or '--help' string. If the shell
207	  finds the string, it will automatically print a help message
208	  for a command.
209
210config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT
211	bool "Printing help on wrong argument count"
212	depends on SHELL_HELP
213	default y if !SHELL_MINIMAL
214
215config SHELL_HISTORY
216	bool "History in shell"
217	default y if !SHELL_MINIMAL
218	select RING_BUFFER
219	help
220	  Enable commands history. History can be accessed using up and down
221	  arrows or Ctrl+n and Ctrl+p meta keys.
222
223config SHELL_HISTORY_BUFFER
224	int "History buffer in bytes"
225	default 128 if SHELL_MINIMAL
226	default 512
227	depends on SHELL_HISTORY
228	help
229	  Number of bytes dedicated for storing executed commands.
230
231config SHELL_STATS
232	bool "Shell statistics"
233	default y if !SHELL_MINIMAL
234
235config SHELL_CMDS
236	bool "Built-in commands"
237	default y if !SHELL_MINIMAL
238	help
239	  Enable built-in commands like 'clear', 'history', etc.
240
241config SHELL_CMDS_RESIZE
242	bool "Resize command"
243	depends on SHELL_CMDS
244	depends on SHELL_VT100_COMMANDS
245	default y if !SHELL_MINIMAL
246	help
247	  By default shell assumes width of a terminal screen set to 80
248	  characters. Each time terminal screen width is changed resize command
249	  must be called to ensure correct text display on the terminal screen.
250	  The resize command can be turned off to save code memory (~0,5k).
251
252config SHELL_CMDS_SELECT
253	bool "Select command"
254	depends on SHELL_CMDS
255	help
256	  This option enables select command. It can be used to set new root
257	  command. Exit to main command tree is with alt+r.
258
259config SHELL_CMD_ROOT
260	string "Set a root command at init"
261	help
262	  This option sets a root command at shell init,
263	  and when exiting to main command tree with alt+r.
264
265config SHELL_LOG_BACKEND
266	bool "Shell log backend"
267	depends on LOG && !LOG_MODE_MINIMAL
268	select MPSC_PBUF
269	select LOG_OUTPUT
270	default y if LOG
271	help
272	  When enabled, backend will use the shell for logging.
273	  This option is enabled by default.
274	  Disabling this option disables log output to all shell backends.
275	  Disabling log output to a specific shell backend can be achieved
276	  using the shell backend's LOG_LEVEL option
277	  (e.g. CONFIG_SHELL_TELNET_INIT_LOG_LEVEL_NONE=y).
278
279config SHELL_LOG_FORMAT_TIMESTAMP
280	bool "Format timestamp"
281	default y
282	depends on SHELL_LOG_BACKEND
283	help
284	  Enable timestamp formatting.
285
286config SHELL_AUTOSTART
287	bool "Auto-start shell at boot"
288	default y
289	help
290	  If enabled, shell will be automatically started.
291
292config SHELL_CMDS_RETURN_VALUE
293	bool "Retval command"
294	depends on SHELL_CMDS
295	default y
296	help
297	  This option enables the retval command. It is used to retrieve
298	  the return value from the most recently executed command.
299
300config SHELL_CUSTOM_HEADER
301	bool "Include Custom Shell Header"
302	help
303	  When enabled, a custom application provided header, named
304	  "zephyr_custom_shell.h", is included at the end of shell.h. This enables
305	  extension of the shell APIs at the macro level. Please use cautiously!
306	  The internal shell API may change in future releases.
307
308source "subsys/shell/modules/Kconfig"
309
310endif # SHELL
311