[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a naive question about EOL encoding in Debian

On Sat, 18 Mar 2023 at 20:45:37 +0100, Patrice Duroux wrote:
> I am facing ^M (\r) character in the .build output file using sbuild
> on my system (Sid).
> For instance:
> $ file timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build
> timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build: ASCII text, with
> very long lines (307), with CRLF, CR, LF line terminators

This is often caused by capturing output from a pseudo-terminal (pty)
like script(1) does. Unix text files conventionally use \n line endings,
and programs conventionally output \n, but Unix terminals must translate
this into \r\n, otherwise the output will show a "staircase" effect
where the cursor doesn't return to column 0 on new lines.

In the case of sbuild logs, all the \r usually come from apt
installing the build-dependencies, which works by capturing text from
a pseudo-terminal.


Reply to: