Skip to content

Commit 120d546

Browse files
[update] <components>:finsh/shell.c
添加以下功能(需要kconfig使能FINSH_USING_WORD_OPERATION) 1 ctrl+back 按单词删除 2 ctrl+左右箭头 按单词切换光标 Signed-off-by: Yucai Liu <1486344514@qq.com>
1 parent 340f1e0 commit 120d546

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/finsh/shell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static void finsh_thread_entry(void *parameter)
640640

641641
continue;
642642
}
643-
#if defined(FINSH_USING_WORD_OPERATION)
643+
#if defined(FINSH_USING_WORD_OPERATION)
644644
/* Add Ctrl+Left/Right handling */
645645
else if (ch == '1')
646646
{
@@ -675,7 +675,7 @@ static void finsh_thread_entry(void *parameter)
675675
}
676676
}
677677
}
678-
#endif /*defined(FINSH_USING_WORD_OPERATION) */
678+
#endif /*defined(FINSH_USING_WORD_OPERATION) */
679679
}
680680

681681
/* received null or error */
@@ -728,7 +728,7 @@ static void finsh_thread_entry(void *parameter)
728728

729729
continue;
730730
}
731-
#if defined(FINSH_USING_WORD_OPERATION)
731+
#if defined(FINSH_USING_WORD_OPERATION)
732732
/* Add Ctrl+Backspace handling */
733733
else if (ch == 0x17) /* Ctrl+Backspace (typically ^W) */
734734
{
@@ -764,7 +764,7 @@ static void finsh_thread_entry(void *parameter)
764764

765765
continue;
766766
}
767-
#endif /*defined(FINSH_USING_WORD_OPERATION) */
767+
#endif /*defined(FINSH_USING_WORD_OPERATION) */
768768
/* handle end of line, break */
769769
if (ch == '\r' || ch == '\n')
770770
{

0 commit comments

Comments
 (0)