Hi,
Good work, committed. Also good idea to accept NULL as history for shellGetLine().
Giovanni
Shell Enhancements Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Shell Enhancements
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.
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 Topic is solved
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--;
}
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Shell Enhancements
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/
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/
- Attachments
-
- Extended-shell-example.7z
- (13.03 KiB) Downloaded 180 times
Who is online
Users browsing this forum: No registered users and 37 guests