Page 2 of 2

Re: Shell Enhancements

Posted: Sat Apr 16, 2016 8:28 am
by Giovanni
Hi,

Good work, committed. Also good idea to accept NULL as history for shellGetLine().

Giovanni

Re: Shell Enhancements

Posted: Mon May 09, 2016 9:14 pm
by bvernoux
Just for information I'm using TokenLine with chibios (in my project hydrafw) see https://github.com/biot/tokenline
I think it is the most powerful shell with completion and tons of very good feature for compact code and fast advanced shell management.

Re: Shell Enhancements

Posted: Mon Nov 14, 2016 9:55 pm
by AdShea
One small patch, currently the shell echos the backspace / delete keycode used to delete characters. Due to several silly choices over the past 30 years, many terminals (linux standard terminals especially) send a 0xFF for the backspace key but need an 0x08, 0x20, 0x08 sent back to properly delete characters (like the ANSI and VT100 specs say). To fix this, just a quick change to os/various/shell/shell.c. With this change, a standard raw terminal will work on Linux.

Code: Select all

--- a/os/various/shell/shell.c
+++ b/os/various/shell/shell.c
@@ -521,9 +521,9 @@ bool shellGetLine(ShellConfig *scfg, char *line, unsigned size, ShellHistory *sh
 #endif
     if ((c == 8) || (c == 127)) {
       if (p != line) {
-        streamPut(chp, c);
+        streamPut(chp, 0x08);
         streamPut(chp, 0x20);
-        streamPut(chp, c);
+        streamPut(chp, 0x08);
         p--;
       }

Re: Shell Enhancements

Posted: Tue Nov 15, 2016 4:58 pm
by Giovanni
Hi,

Thanks, moving this topic in "bug reports" for handling.

Giovanni

Re: Shell Enhancements

Posted: Mon Nov 21, 2016 9:53 am
by Giovanni
Fixed on repository, thanks.

Giovanni

Re: Shell Enhancements

Posted: Sun Aug 11, 2019 3:06 pm
by Luri
A small example to use this enhancements feature.

You must modify makefile to add -D SHELL_CONFIG_FILE to compiler option. (see makefile in my example)
This allow to use your own shellconf.h in your root projet directory. We this, you can set on history and completion.
You can also enable or disable each chibios shell function.

example projet is tested with Nucléo STM32F767, ChibiOS 19.1.3, GNU ARM 8.3.1 2019q3, And this patch for chibistudio openocd

If you play with shell, you probably want add a serial console to ChibiStudio. See that : https://mcuoneclipse.com/2015/04/20/ser ... ipse-luna/