arduino / arduino/ArduinoCore-avr

[enhancement] let println() set the endline characters

Open
#498 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

hi.... something that set me itchy sometimes is the inability to change the hardcoded `\r\n` line endings in println()...

additionally with adding an EXTRA BYTE to every println() (maybe not in source code but in printing for sure), there are many consoles and terminal emulators and systems that can perfectly handle just `\n` (come on... that `\r\n` thing is from telegraph and teletype writers epoch)....

and would be also easier to code... for example for received strings, a single `Stream.readBytesUntil(buffer, '\n')` would do the trick, without the need to trim the remaining trailing `\r` that could complicate things further.... could even add support for other protocols (some uses `\r`, `\0`, `\xFF` `;` or other line ending instead of `\n`)

i know how to do it for myself alone... it would suffice with editing `cores/Print.h|cpp` and define some macro to `println()`, that way i could just redefine the macro in my sketch.... but i am really talking about include it in the next release so everyone could enjoy this enhancement **natively**, not just me

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading cores/Print.h and cores/Print.cpp to locate println() and understand how its line ending is currently defined. The issue proposes configurable endings, including \n, \r, \0, \xFF, or other delimiters; done would require an agreed native API and verified println() behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.