Color ANSI support in nsh

2020-08-15 Thread Christian Catchpole
Hi everyone, I have been adding ANSI escape codes for colour support to my app’s console output and have been experimenting with adding it to nsh itself. At a minimum to colour the prompt. I had been thinking this is something i could develop and propose to come back into the mainline as a nsh kc

RE: Color ANSI support in nsh

2020-08-16 Thread David Sidrane
have scripted test running against the sim (or real HW) test cases will keep it from breaking. David -Original Message- From: Christian Catchpole [mailto:christ...@catchpole.net] Sent: Saturday, August 15, 2020 5:52 PM To: dev@nuttx.apache.org Subject: Color ANSI support in nsh Hi

Re: Color ANSI support in nsh

2020-08-16 Thread Dave Marples
Message- > From: Christian Catchpole [mailto:christ...@catchpole.net] > Sent: Saturday, August 15, 2020 5:52 PM > To: dev@nuttx.apache.org > Subject: Color ANSI support in nsh > > Hi everyone, > > I have been adding ANSI escape codes for colour support to my app’s console > output

Re: Color ANSI support in nsh

2020-08-16 Thread Christian Catchpole
-Original Message----- > > From: Christian Catchpole [mailto:christ...@catchpole.net] > > Sent: Saturday, August 15, 2020 5:52 PM > > To: dev@nuttx.apache.org > > Subject: Color ANSI support in nsh > > > > Hi everyone, > > > > I have been adding ANSI esc

Re: Color ANSI support in nsh

2020-08-16 Thread Alan Carvalho de Assis
test running against the sim (or real HW) >> > test >> > cases will keep it from breaking. >> > >> > David >> > >> > -Original Message- >> > From: Christian Catchpole [mailto:christ...@catchpole.net] >> > Sent: Saturday,

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 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-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-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 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 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 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 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
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 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
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 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 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 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 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 *