lazygit
lazygit copied to clipboard
emoji in diff causes doubled characters
Describe the bug A line in a diff beginning with an emoji causes the rest of the line to become doubled:
Here is the actual diff: https://codeberg.org/librewolf/website/pulls/97/commits/f41dd9b3eb3a8a0c09bf64fe6302b3dd4e1622da
Version info:
$ lazygit --version
commit=, build date=, build source=unknown, version=0.47.2, os=linux, arch=amd64, git version=2.48.1
$ git --version
git version 2.48.1
More data:
- If I use the arrow keys to select a different commit, then come back to the one with the emoji, the doubled characters go away, but instead of just
⚠️it shows⚠️Vor sometimes⚠️VTat the beginning of the line - If I set delta as the pager, the doubled characters still appear. Using the arrow keys to go down one commit and back up makes the doubled characters go away, and the V doesn't appear either, but after a second or two it flashes back to doubled character mode.
Can you clarify what terminal you use? A lot of emoji problems can be related to that.
And what does the diff look like in your terminal when you just do a git diff outside of lazygit?
I cloned your repo, and when I run it inside of WSL2 in Wezterm, it looks totally fine. When I launch tmux, that's when the issue comes in.
Inside TMUX:
Outside TMUX:
Might be connected to the issues described in this article? https://mitchellh.com/writing/grapheme-clusters-in-terminals which I found from this pull request comment: https://github.com/jesseduffield/lazygit/pull/4247#issuecomment-2646375598
This issue might be a duplicate of https://github.com/jesseduffield/lazygit/issues/3811?
Yes I'm using tmux inside of kitty
I also encounter this issue with diff lines that contain emoji characters. I'm using Tmux, but I can reproduce the problem outside of Tmux as well, using the default macOS Terminal app.
Correct:
After scrolling:
Just to chime in with another data point: I observe the same behavior with iTerm2 (3.5.14), no tmux, no custom fonts.
More specifically, the rendering error only appears after a second or so of staying on the file diff view, without scrolling or touching any key.
It goes from this:
to this:
And it also leaves some random characters on the screen, even when I jump to the branch view or something else.
One interesting thing is that when trying to reproduce in a minimal repo (init repo, add a text file with "foo", commit, then add a line with ⚠️ emoji, then check in lazygit), this doesn't happen - it renders correctly.