File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,33 @@ static void finsh_thread_entry(void *parameter)
607607 shell -> line_curpos ++ ;
608608 }
609609
610+ continue ;
611+ }
612+ else if (ch == 0x33 ) /* delete key */
613+ {
614+ /* note that shell->line_curpos >= 0 */
615+ if (shell -> line_curpos < 0 )
616+ continue ;
617+
618+ if (shell -> line_position > shell -> line_curpos )
619+ {
620+ rt_kprintf ("%c" , shell -> line [shell -> line_curpos ]);
621+ shell -> line_position -- ;
622+
623+ int i ;
624+
625+ rt_memmove (& shell -> line [shell -> line_curpos ],
626+ & shell -> line [shell -> line_curpos + 1 ],
627+ shell -> line_position - shell -> line_curpos );
628+ shell -> line [shell -> line_position ] = 0 ;
629+
630+ rt_kprintf ("\b%s \b" , & shell -> line [shell -> line_curpos ]);
631+
632+ /* move the cursor to the origin position */
633+ for (i = shell -> line_curpos ; i <= shell -> line_position ; i ++ )
634+ rt_kprintf ("\b" );
635+ }
636+
610637 continue ;
611638 }
612639 }
You can’t perform that action at this time.
0 commit comments