mynewt-core icon indicating copy to clipboard operation
mynewt-core copied to clipboard

Full console: suppress new line when echo is disabled

Open dwld opened this issue 5 years ago • 4 comments

When echo is switched off via console_echo(0), also new line should be suppressed.

dwld avatar Feb 18 '20 11:02 dwld

Style check summary

No suggestions at this time!

apache-mynewt-bot avatar Feb 18 '20 15:02 apache-mynewt-bot

Hi @dwld, I tell you why this takes so much time with such simple reasonable change. For a long time console code that was modified by a few people did not really handled few control characters resulting in some echo while console was configured to be silent except for NLIP protocol. In late 2019 I changed it so not echo for CR LF (and other control characters showed) but one company that uses mynewt was affected since they relayed on this not so obvious behavior. So 153dfb8b7d13f0cf16298fd6e3b5235909fe2f30 restored echo for CR/LF just as not to break backward compatibility. I probably should have add conditional code for allowing this echo if someone really needs it, instead of always, which is not something that would be expected from the code. So that is why no one is rushing to accept this.

kasjer avatar Feb 25 '20 18:02 kasjer

Hi @kasjer, thanks for the explanation. I understand. For our use cases, this behavior breaks the asynchronous communication. Would the introduction of another switch to suppress the echo for CR/LF be an option?

dwld avatar Feb 26 '20 17:02 dwld

Hi @dwld quick question, are you using nlip protocol or some other custom protocol and you are not really interested in nlip handling? If you are not going to use nlip (that seem like reasonable option) that I will add switch to just disable nlip handling and this will reduce code size and runtime cpu usage. But what I've noticed when looking at you proposal is that console_echo() function that is public api for disabling console echo and it should not be used inside console code to turn on/off echo for other reason as it is done currently. And this also cries for fix. btw you proposal for call console_echo(echo); would not make any difference and could be just totally dropped to achieve same goal. Fixes are on the way...

kasjer avatar Mar 09 '20 12:03 kasjer