Files
rtems/cpukit/libmisc/shell
Frank Kühndel ffc928b9a2 Fixing bug in line editing of the shell with CTRL-U.
This patch fixes a tiny bug in the command line editing of the RTEMS shell.
Typing CTRL-U in the shell should remove all characters left of the cursor.
After pressing CTRL-U, the current implementation does wrongly place the cursor
at the end of the line instead at its beginning.

To reproduce the bug, start the shell and type 'abc123' (no <RETURN>):

> ~/src/rtems $ qemu-system-arm -net none -nographic -M realview-pbx-a9 \
  -m 256M -kernel build/arm/realview_pbx_a9_qemu/testsuites/libtests/dl10.exe
> *** BEGIN OF TEST libdl (RTL) 10 ***
> *** TEST VERSION: 6.0.0.d9bdf166644f612dd628fe4951c12c6f8e94ba5f
> *** TEST STATE: USER_INPUT
> *** TEST BUILD: RTEMS_DEBUG RTEMS_NETWORKING RTEMS_POSIX_API RTEMS_SMP
> *** TEST TOOLS: 10.2.1 20200904 \
  (RTEMS 6, RSB 31f936a7b74d60bda609a9960c6e1a705ba54974, Newlib a0d7982)
> RTL (libdl) commands: dl, rtl
>
> RTEMS Shell on /dev/foobar. Use 'help' to list commands.
> SHLL [/] # abc123

Then move the cursor onto the '1' by hitting three times the <ARROW-LEFT> key.
Next type <CTRL>-U:

> SHLL [/] # 123

Note that the cursor is at the end of the line (after '3') instead of correctly
at the beginning (on the '1'), now.

Continuing typing 'echo ' incorrectly results in the output:

> SHLL [/] # 123echo 123

The patch changes this behavior so that the cursor in the second last step will
be on the '1' and typing 'echo ' will then correctly reflected as:

> SHLL [/] # echo 123

Close #4097.
2020-09-28 14:16:06 +02:00
..
2015-10-26 09:13:19 +01:00
2015-10-26 09:13:19 +01:00
2017-12-13 09:04:27 +01:00
2020-04-16 07:30:00 +02:00
2020-04-16 07:30:00 +02:00
2020-04-16 07:30:00 +02:00
2020-04-16 07:30:00 +02:00
2020-04-16 07:30:00 +02:00
2020-04-28 09:04:00 +02:00
2020-04-16 07:30:00 +02:00
2015-10-26 09:13:19 +01:00
2020-04-16 07:30:00 +02:00
2017-08-25 10:58:58 +02:00
2019-01-07 09:49:16 +01:00
2015-10-26 09:13:19 +01:00
2017-08-25 10:58:58 +02:00
2015-10-26 09:13:19 +01:00
2017-08-22 14:18:58 +02:00
2020-04-16 07:30:00 +02:00

This directory contains a shell user extension
primary features:

   + create a user shell terminal task.

This code has not been extensively tested.  It is provided as a tool
for RTEMS users to open more shell terminal.
Suggestions and comments are appreciated.

NOTES:

1.  printf() & getchar() works but you can't use 
    0,1,2 like fildes. You need to use fileno(stdin),fileno(stdout),...
    
2.  You only need a termios dev to start a new session, add your new commands
    and enjoy it.

3.  Telnetd daemon uses this (browse libnetworking/rtems_telnetd)
    Enjoy it.

FUTURE:

1.  Adding new commands in cmds.c to give file manegement to shell.