Logger: optional CR insertion for terminals without LF→CRLF handling #3624
Unanswered
pputerla
asked this question in
Component enhancements
Replies: 2 comments 1 reply
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
You can make a PR. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
logger
Link to component documentation on our website
https://esphome.io/components/logger/
Describe the enhancement
Add an optional configuration flag to the logger component, for example:
When enabled, each \n sent on wire would be expanded to \r\n.
Use cases
Background
The logger component currently emits newlines using LF (\n) only, which is generally correct and expected.
However, some terminals do not interpret LF as a full newline (i.e., they do not perform carriage return). In such cases, log output becomes “staircased” because each new line starts at the previous cursor position.
This can be observed, for example, when using the Wokwi VS Code extension serial monitor, where LF does not imply CR. In contrast, early boot logs from ESP-IDF (e.g., bootloader output) appear correctly formatted, suggesting they use CRLF.
Anything else?
I already have a working local version of this change. Is it ok to share it?
Implementation is trivial (10 lines in write_to_console_ method ) and does not introduce memory overhead.
Beta Was this translation helpful? Give feedback.
All reactions