jesseduffield / jesseduffield/lazygit

Cariage return (^M) in output of delta pager makes line disappear from diff

Open
#1,665 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
Having carriage return in the output of diff pager makes lazygit erase line when displaying diff
To be specific, I am using `delta` as pager

**To Reproduce**

```yaml
# ~/.config/jesseduffield/lazygit/config.yml
git:
paging:
colorArg: always
pager: delta --dark --paging=never
```

```
~/git> mkdir test && cd test && git init
Initialised empty Git repository in /home/kolia/git/test/.git/
~/git/test> echo "some text" > file.txt
~/git/test> git add file.txt
~/git/test> git commit -m "first commit"
[master (root-commit) 93b4ee7] first commit
1 file changed, 1 insertion(+)
create mode 100644 file.txt
~/git/test> echo -e "modified text\r" > file.txt
~/git/test> lazygit
```

**Actual behavior**
modified line is displayed as empty line

**Expected behavior**
display the content of modified line

**Screenshots**

output from pager is not displaying content of modified line

![Screenshot_20220112_061346](https://user-images.githubusercontent.com/12046452/149057570-22a4a78b-d357-4ef5-b148-9ffe417ba237.png)

when staging / unstaging individual lines, no pager involved, the modified line is displayed properly

![Screenshot_20220112_061731](https://user-images.githubusercontent.com/12046452/149057846-a709363c-a68f-4ada-b8d2-0cd145d2ed9c.png)

notice, the pager `delta`, when used outside `lazygit`, displays carriage return as ^M at the end of line:

![Screenshot_20220112_062646](https://user-images.githubusercontent.com/12046452/149058719-96a4f216-b5b5-4a41-b76e-bdda2047cbc4.png)

**Desktop (please complete the following information):**
- OS: kubutu 20.04
- Lazygit Version: current master at 4744b3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.