Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 39 additions & 28 deletions components/finsh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,28 @@ if RT_USING_MSH
config FINSH_USING_HISTORY
bool "Enable command history feature"
default y

if FINSH_USING_HISTORY
config FINSH_HISTORY_LINES
int "The command history line number"
default 5
endif
if FINSH_USING_HISTORY
config FINSH_HISTORY_LINES
int "The command history line number"
default 10
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API design: Breaking change in default value / API 设计:默认值的破坏性更改

English: The default value for FINSH_HISTORY_LINES has been changed from 5 to 10. While this improves functionality, it increases memory usage by 100% for users who rely on the default. This is a breaking change for embedded systems with tight memory constraints.

Recommendation: Consider keeping the default at 5 for backward compatibility, or clearly document this change in the PR description as a breaking change with memory impact.

中文: FINSH_HISTORY_LINES 的默认值从 5 更改为 10。虽然这改进了功能,但对于依赖默认值的用户,内存使用增加了 100%。这对于内存紧张的嵌入式系统是一个破坏性更改。

建议: 考虑保持默认值为 5 以实现向后兼容,或在 PR 描述中明确记录此更改为具有内存影响的破坏性更改。

Suggested change
default 10
default 5

Copilot uses AI. Check for mistakes.
endif

config FINSH_USING_SNAPSHOT
bool "Enable command Ctrl+Z/Ctrl+Y snapshot feature"
default n
if FINSH_USING_SNAPSHOT
config FINSH_SNAPSHOT_DEPTH
int "The command snapshot depth"
default 10
endif
Comment on lines 38 to 51
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation: Missing help text / 文档:缺少帮助文本

English: The new FINSH_USING_SNAPSHOT configuration option lacks a help section explaining what the snapshot feature does and how Ctrl+Z/Ctrl+Y work. Users configuring the system need this information to decide whether to enable it.

Recommendation: Add a help section:

help
    Enable snapshot feature for command history. Ctrl+Z undoes recent edits,
    Ctrl+Y redoes undone edits. This feature requires additional memory
    based on FINSH_SNAPSHOT_DEPTH setting.

中文: 新的 FINSH_USING_SNAPSHOT 配置选项缺少 help 部分来解释快照功能的作用以及 Ctrl+Z/Ctrl+Y 如何工作。配置系统的用户需要此信息来决定是否启用它。

建议: 添加帮助部分:

help
    启用命令历史的快照功能。Ctrl+Z 撤销最近的编辑,
    Ctrl+Y 重做已撤销的编辑。此功能需要基于
    FINSH_SNAPSHOT_DEPTH 设置的额外内存。

Copilot uses AI. Check for mistakes.

config FINSH_USING_WORD_OPERATION
bool "Enable word-based cursor operations"
bool "Enable Ctrl+W/Backspace/Ctrl+Left/Right word-based cursor operations"
default n
help
Enable Ctrl+Backspace to delete words and Ctrl+Arrow to move cursor by word

config FINSH_USING_FUNC_EXT
bool "Enable function extension home end ins del"

config FINSH_USING_EXTEND_FEATURE
bool "Enable insert/delete/home/end extend feature"
default n
help
Enable function extension home end ins del.

config FINSH_USING_SYMTAB
bool "Using symbol table for commands"
Expand All @@ -67,24 +71,31 @@ if RT_USING_MSH
config FINSH_ECHO_DISABLE_DEFAULT
bool "Disable the echo mode in default"
default n

config FINSH_PROMPT_ENABLE_DEFAULT
bool "Enable the prompt mode in default"
default y

config FINSH_PROMPT_WORD_DEFAULT
string "The default prompt word"
default "msh "

config FINSH_USING_AUTH
bool "shell support authentication"
default n

if FINSH_USING_AUTH
config FINSH_DEFAULT_PASSWORD
string "The default password for shell authentication"
default "rtthread"

config FINSH_PASSWORD_MIN
int "The password min length"
default 6

config FINSH_PASSWORD_MAX
int "The password max length"
default RT_NAME_MAX
endif
if FINSH_USING_AUTH
config FINSH_DEFAULT_PASSWORD
string "The default password for shell authentication"
default "rtthread"

config FINSH_PASSWORD_MIN
int "The password min length"
default 6

config FINSH_PASSWORD_MAX
int "The password max length"
default RT_NAME_MAX
endif

config FINSH_ARG_MAX
int "The number of arguments for a shell command"
Expand Down
Loading
Loading