Skip to content

Fix rendering of CRLF sequence ('\r\n')#5237

Merged
stefanhaller merged 1 commit into
masterfrom
fix-rendering-of-crlf
Jan 28, 2026
Merged

Fix rendering of CRLF sequence ('\r\n')#5237
stefanhaller merged 1 commit into
masterfrom
fix-rendering-of-crlf

Conversation

@stefanhaller
Copy link
Copy Markdown
Collaborator

@stefanhaller stefanhaller commented Jan 25, 2026

Fixes #5188.

@stefanhaller stefanhaller added the bug Something isn't working label Jan 25, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jan 25, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 4c9cc1a1
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4c9cc1a) Report Missing Report Missing Report Missing
Head commit (06a9ff1) 59610 51943 87.14%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5237) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@T3sT3ro
Copy link
Copy Markdown

T3sT3ro commented Jan 28, 2026

Fix confirmed working 👍

This brings in jesseduffield/gocui#98 with the following
fix:

Fix rendering of CRLF sequence ('\r\n')

The FirstGraphemeCluster call returns this as a single character; we want to
treat it the same way as a single \n.

This would be a problem if e.g. a progress bar used \r repeatedly to paint over
the same line, and then printed a \n to move on to the next line; the last pair
of \r and \n was swallowed.

Another scenario where this was a problem was if you stream output of a command
to the log, and the command used \r\n as line feeds. This happens for example
for a background fetch that fails with an error; in that case we print the
combined output (stdout plus stderr) to the log after the command finished, and
for some reason it uses \r\n in that case (I can't actually explain why; when I
do `git fetch --all | xxd` I see only bare \n characters). All output would
appear on one line then.

Also, filter out escape sequences for character set designation; there's nothing
useful we can do with them. In practice, the only one that you are likely to see
is `ESC ( B`, which is sent as part of tput sgr0, which is sometimes used in
scripts to reset all graphics attributes to defaults.
@stefanhaller stefanhaller force-pushed the fix-rendering-of-crlf branch from 7169319 to 06a9ff1 Compare January 28, 2026 19:57
@stefanhaller stefanhaller merged commit be703f3 into master Jan 28, 2026
13 checks passed
@stefanhaller stefanhaller deleted the fix-rendering-of-crlf branch January 28, 2026 19:59
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 15, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.58.1` → `v0.59.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary>

### [`v0.59.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.59.0)

[Compare Source](jesseduffield/lazygit@v0.58.1...v0.59.0)

<!-- Release notes generated using configuration in .github/release.yml at v0.59.0 -->

#### What's Changed

##### Enhancements 🔥

- Have "Find base commit for fixup" ignore fixup commits for the found base commit by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5210](jesseduffield/lazygit#5210)
- Exclude commit trailers from line wrapping by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5230](jesseduffield/lazygit#5230)
- Limit popup panel widths to a maximum width by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5231](jesseduffield/lazygit#5231)
- Support using the selected commit's message in a fixup by [@&#8203;jesseduffield](https://github.com/jesseduffield) in [#&#8203;5233](jesseduffield/lazygit#5233)
- Fix gitignore path collisions by [@&#8203;DawidPietrykowski](https://github.com/DawidPietrykowski) in [#&#8203;5245](jesseduffield/lazygit#5245)

##### Fixes 🔧

- Don't log the "git rev-list" call when marking bisect commits by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5236](jesseduffield/lazygit#5236)
- Fix opening a menu when a previous menu was scrolled down by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5238](jesseduffield/lazygit#5238)
- When moving commits up/down and the selection leaves the view, scroll to make it visible again by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5247](jesseduffield/lazygit#5247)
- Fix rendering of CRLF sequence ('\r\n') by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5237](jesseduffield/lazygit#5237)
- Fix rendering of the Reflog panel when using up/down to scroll it by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5248](jesseduffield/lazygit#5248)
- Add Nushell support for nvim-remote preset by [@&#8203;baiyeidk](https://github.com/baiyeidk) in [#&#8203;5250](jesseduffield/lazygit#5250)

##### Maintenance ⚙️

- Update devcontainer `VARIANT` to `1-trixie` by [@&#8203;mricherzhagen](https://github.com/mricherzhagen) in [#&#8203;5204](jesseduffield/lazygit#5204)
- chore: Update outdated GitHub Actions versions by [@&#8203;pgoslatara](https://github.com/pgoslatara) in [#&#8203;5220](jesseduffield/lazygit#5220)
- Disable the automatic, scheduled release by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5272](jesseduffield/lazygit#5272)
- Auto-update cheatsheets after updating translation by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5275](jesseduffield/lazygit#5275)

##### Docs 📖

- Update README to add GitArbor TUI as an alternative by [@&#8203;cadamsdev](https://github.com/cadamsdev) in [#&#8203;5257](jesseduffield/lazygit#5257)
- Update docs and schema for release by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5276](jesseduffield/lazygit#5276)

##### I18n 🌎

- Update translations from Crowdin by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;5274](jesseduffield/lazygit#5274)

#### New Contributors

- [@&#8203;pgoslatara](https://github.com/pgoslatara) made their first contribution in [#&#8203;5220](jesseduffield/lazygit#5220)
- [@&#8203;cadamsdev](https://github.com/cadamsdev) made their first contribution in [#&#8203;5257](jesseduffield/lazygit#5257)
- [@&#8203;baiyeidk](https://github.com/baiyeidk) made their first contribution in [#&#8203;5250](jesseduffield/lazygit#5250)

**Full Changelog**: <jesseduffield/lazygit@v0.58.1...v0.59.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ni4yIiwidXBkYXRlZEluVmVyIjoiNDIuOTYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

command log output messed up and 0.58.0 regression (ANSI sgr0 as (B, missing newlines)

2 participants