This should make sure our log lines look nice even if the tty we are connected to is in raw mode. Normally, it's the TTY's job to turn an NL we output into a CRNL and interpret it accordingly. However, if the tty is in "raw" mode it won't do that. Specifically, this is controlled by the ONLCR flag on the TTY. A TTY might be in raw mode if our "ptyfwd" logic is used for example, where a 2nd tty is bi-directionally connected to the primary tty, and duplicate processing is not desired. Hence, let's just write out the CR on our own. This will make sure that whenever we output something subsequent output always continues on the beginning of the next line again, regardless the mode the TTY is in. Of course, if the TTY is *not* in raw mode, then the extra CR we now generate is redundant, but it shouldn't hurt either, as it just moves the cursor to the front of the line even though already is just there. We only to that if we actually talk to a TTY though, since we don't want the extra CRs if we are redirected to a pipe or file or so. We are not on Windows after all. Fixes: #30155
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
