pub fn resolve_carriage_returns(s: &str) -> StringExpand description
Resolve carriage-return (\r) progress overwrites in captured output.
CLI tools like git, cargo, and npm use \r to draw in-place progress
updates. When stdout is captured (not a TTY), these bytes survive as literal
\r characters and produce glued-together lines (#1140). This function
emulates terminal behaviour: for each line, only the content after the last
\r is kept.