Line endings <CR><CR><LF> ignored

If you have specific questions or problems with any of my Freeware applications, post them here.
Post Reply
BerLech
Posts: 3
Joined: Wed Mar 24, 2021 2:20 am

Line endings <CR><CR><LF> ignored

Post by BerLech »

Hi,

Thanks for this great terminal software, especially the HEX view combined with the ability to enter custom baud rates is what it makes so valuable for me.

I have discovered one issue with line endings. I have a linux based system, which sends all kinds of line endings in the same data stream over the serial interface. The data is just a log file. Mostly a <CR><LF>, a single <LF> but also a single <CR> is sent as the line ending. Here, everything is working as expected.

Sometimes, the combination <CR><CR><LF> is sent. If such a character combination comes in, either with or without preceeding characters, the line ending is ignored at all and the cursor stays after the last visible character. The next caracter is just written after that on the same line. If I activate the Option "Ignore line feed character", this double-<CR> line endings are handled correctly, generating a empty line in ASCII view. This would be the expected behaviour, but the lines only containing a <LF> as line end wont show the correct behaviour.

Furtheron I have a modem (from ublox) which shows this combination as well. So probably not very uncommon.

I kindly ask you to have a look into the code what's going on here. I checked the options, the help file and the forum. Unfortunately, I have not found any solution for that. Probably this is a "feature"? ;)

In the following example using a modem with echo on, the comination is received just before the modem response "+URAT: 7". I am using CoolTerm 1.8.0 Build 861 in line mode.

ASCII mode:

Code: Select all

at+urat?
at+urat?+URAT: 7

OK
HEX Mode:

Code: Select all

61 74 2B 75 72 61 74 3F 0D 0A 61 74 2B 75 72 61
74 3F 0D 0D 0A 2B 55 52 41 54 3A 20 37 0D 0A 0D
0A 4F 4B 0D 0A
Thanks a lot and best regards,
Bernhard
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Line endings <CR><CR><LF> ignored

Post by roger »

Hi Bernhard,

CoolTerm uses a TextArea control to render text. This is the native text box control that the OS provides, and how that control handles CR and LF characters is determined by the OS.
<CR>, <CR><LF>, and <LF> are all handled as a new line character, across platforms. However, it seems that on some operating systems, other combinations of CR and LF may be interpreted as something different, such as in your case.

The good news is that I'm current working on v1.9.0 which includes an option to combine contiguous CR characters. This should convert your CR+CR+LF into CR+LF before displaying the text.

If you're interested in testing the latest beta, please sign up for the mailing list at http://the-meiers.org/mailman/listinfo/ ... meiers.org to get access.

Roger
BerLech
Posts: 3
Joined: Wed Mar 24, 2021 2:20 am

Re: Line endings <CR><CR><LF> ignored

Post by BerLech »

Hi Roger,

thanks for your answer and offer to join the beta program. I downloaded the version 1.9.0b1 and it looks promising. as soon I have the possibility to test with the specific system, I will do so and let you know the outcome.

Bernhard
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Line endings <CR><CR><LF> ignored

Post by roger »

BerLech wrote:thanks for your answer and offer to join the beta program. I downloaded the version 1.9.0b1 and it looks promising. as soon I have the possibility to test with the specific system, I will do so and let you know the outcome.
Great! Let me know how it goes.
BerLech
Posts: 3
Joined: Wed Mar 24, 2021 2:20 am

Re: Line endings <CR><CR><LF> ignored

Post by BerLech »

Hi Roger,

today, I had the possibility to try CoolTerm-1.9.0b4 on the system sending multiple <CR> characters. Either "Combine continuous CR" or "HandleCR as real CR" give me now a correctly formatted output. So I would say: Well done, thanks a lot. :)

Regards,
Bernhard
Post Reply