-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[update] <components>:finsh/shell.c 增加新功能 #10394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
20caba4
to
d7feea8
Compare
感觉这样做了以后,是否会变得复杂化?对于shell来说,反而希望增加"一些类脚本的简单功能,例如可以定义变量,一些变量甚至可以存储下来,以及包含简单的条件处理。" 当然,这些高级功能应该是可配置,可裁剪的。 |
“在调试长命令时,单词级操作可提升效率。此功能在主流 Shell(如 bash/zsh)中为标准支持” |
components/finsh/shell.c
Outdated
/* Delete characters with proper RT_null termination */ | ||
rt_memmove(&shell->line[start], | ||
&shell->line[start + del_count], | ||
new_len - start + 1); // +1 包含 RT_null 终止符 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请使用英文的注释。下同
components/finsh/shell.c
Outdated
{ | ||
if (curpos <= 0) return 0; | ||
|
||
// Skip whitespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请尽可能使用 /* */
C语言风格的注释,下同。
添加以下功能(需要kconfig使能FINSH_USING_WORD_OPERATION) 1 ctrl+back 按单词删除 2 ctrl+左右箭头 按单词切换光标 Signed-off-by: Yucai Liu <[email protected]>
添加以下功能 (需要kconfig使能FINSH_USING_WORD_OPERATION)
1 ctrl+back 按单词删除
2 ctrl+左右箭头 按单词切换光标
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up