Re: Color ANSI support in nsh

2020-08-17 Thread Christian Catchpole
Thanks Matias! I've dropped the code into a gist if anyone is interested in using it. It's c++ but of course wouldn't take much to turn in a C with structs. and of course modify it in other ways to your own needs. You simply call one of these methods.. void log(const char * source, const char *

Re: Color ANSI support in nsh

2020-08-17 Thread Alan Carvalho de Assis
I liked it to! Should be nice to have some "text bar" widgets too, like we have in the alsamixer ;-) BR, Alan On 8/17/20, Matias N. wrote: > I really liked your telemetry app with colored output you shown on the > video. > > On Mon, Aug 17, 2020, at 20:47, Christian Catchpole wrote: >> somethi

Re: Color ANSI support in nsh

2020-08-17 Thread Matias N.
I really liked your telemetry app with colored output you shown on the video. On Mon, Aug 17, 2020, at 20:47, Christian Catchpole wrote: > something to consider with querying the terminal for capabilities / > terminal size etc, is where there is no terminal actually connected at the > time. this

Re: Color ANSI support in nsh

2020-08-17 Thread Christian Catchpole
something to consider with querying the terminal for capabilities / terminal size etc, is where there is no terminal actually connected at the time. this would cause it to hang or require timeouts or other complications. but i guess querying might only occur after user input. Again, as long as its

Re: Color ANSI support in nsh

2020-08-17 Thread Gregory Nutt
A basic terminfo/termcaps  could be very trivial A more general solution would be handy but what is there really in the embedded world that doesn't support vt100? There more code there is, the more interesting ways it can go wrong :-) I have sometimes used cat /dev/ttyS0 on the host as a termi

Re: Color ANSI support in nsh

2020-08-17 Thread Dave Marples
A more general solution would be handy but what is there really in the embedded world that doesn't support vt100? There more code there is, the more interesting ways it can go wrong :-) (BTW; ctrl-L to clear the screen was one of the first things I added after fixing backspace/deleteboth of th

Re: Color ANSI support in nsh

2020-08-17 Thread Gregory Nutt
I would suggest that you look at how this is handled in standard terminals. This works in the form of escape sequence which give a code that the terminal can interpret as being a color. This would make it available to applications in a standard form. Good point.  The GNU part of GNU/Linux d

Re: Color ANSI support in nsh

2020-08-17 Thread Matias N.
Having the ability to display color on the console is really useful to provide easy to read output in many scenarios (e.g. test with OK/ERROR). But I agree it should be disabled by default and not overly complicate things. I would suggest that you look at how this is handled in standard termina

Re: Color ANSI support in nsh

2020-08-17 Thread Gregory Nutt
This is my suggestion, it should be enabled by default, but disabled by default if CONFIG_DEFAULT_SMALL is selected. What do you think? I would prefer to see it just disabled by default.

Re: Color ANSI support in nsh

2020-08-17 Thread Alan Carvalho de Assis
oo it 😉 Color is throwing >> money where functionality died >> >> Ben >> >> -Oorspronkelijk bericht- >> Van: Alan Carvalho de Assis >> Verzonden: zondag 16 augustus 2020 17:02 >> Aan: dev@nuttx.apache.org >> Onderwerp: Re: Color AN

Re: Color ANSI support in nsh

2020-08-17 Thread Maciej Wójcik
, wrote: > > > > > > > Please do not make technology about looks in functionality it has > > to > > > > work and be solid and has to address its purposes. If all is finished > > and > > > > value is there, one could bring a nice color too it 😉 C

Re: Color ANSI support in nsh

2020-08-17 Thread Christian Catchpole
solid and has to address its purposes. If all is finished > and > > > value is there, one could bring a nice color too it 😉 Color is > throwing > > > money where functionality died > > > > > > Ben > > > > > > -Oorspronkelijk berich

Re: Color ANSI support in nsh

2020-08-17 Thread Dave Marples
ts purposes. If all is finished and > > value is there, one could bring a nice color too it 😉 Color is throwing > > money where functionality died > > > > Ben > > > > -Oorspronkelijk bericht- > > Van: Alan Carvalho de Assis > > Verzonde

Re: Color ANSI support in nsh

2020-08-16 Thread Maciej Wójcik
bericht- > Van: Alan Carvalho de Assis > Verzonden: zondag 16 augustus 2020 17:02 > Aan: dev@nuttx.apache.org > Onderwerp: Re: Color ANSI support in nsh > > Christian, > > If I'm not wrong NuttX already has this feature to fancy interface if you > use of pdcurse

RE: Color ANSI support in nsh

2020-08-16 Thread disruptivesolutionsnl
- Van: Alan Carvalho de Assis Verzonden: zondag 16 augustus 2020 17:02 Aan: dev@nuttx.apache.org Onderwerp: Re: Color ANSI support in nsh Christian, If I'm not wrong NuttX already has this feature to fancy interface if you use of pdcurses library. Greg added pdcurses some time ago and Ken

Re: Color ANSI support in nsh

2020-08-16 Thread Alan Carvalho de Assis
Christian, If I'm not wrong NuttX already has this feature to fancy interface if you use of pdcurses library. Greg added pdcurses some time ago and Ken Petit added support to use it over telnet BR, Alan On 8/16/20, Christian Catchpole wrote: > Yeah i should have had a poke around before posti

Re: Color ANSI support in nsh

2020-08-16 Thread Christian Catchpole
Yeah i should have had a poke around before posting on the group. I keep finding NuttX has so many features in the Kconfig :) I also suggested command history then found my Spresence NSH has history, so obviously i was not the first to think of it. I don't want to go TOO crazy with ANSI colours. I'

Re: Color ANSI support in nsh

2020-08-16 Thread Dave Marples
Hiya, Yes, there's some cheesy simple stuff in there already (mainly to stop the zephyr folks throwing shade cos their terminal is prettier). At the moment it only highlights commands, responses and errors iirc, but making it more context aware would certainly be niceit's already switched on/o

RE: Color ANSI support in nsh

2020-08-16 Thread David Sidrane
Hi Christian, As long as there is a Knob in Kconfig to enable / disable each feature (that defaults to disable) the impact is 0. IIRC there is a history, and some fancy-ness that was added by Dave a while ago. Good docs and an example defconfig would will keep it maintained (and built). Once we h