lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

emoji in diff causes doubled characters

Open durka opened this issue 8 months ago • 6 comments
trafficstars

Describe the bug A line in a diff beginning with an emoji causes the rest of the line to become doubled:

Image

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

durka avatar Mar 01 '25 21:03 durka

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 ⚠️V or sometimes ⚠️VT at 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.

durka avatar Mar 01 '25 21:03 durka

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?

ChrisMcD1 avatar Mar 01 '25 23:03 ChrisMcD1

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: Image

Outside TMUX:

Image

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

ChrisMcD1 avatar Mar 01 '25 23:03 ChrisMcD1

This issue might be a duplicate of https://github.com/jesseduffield/lazygit/issues/3811?

ghost-in-the-zsh avatar Apr 10 '25 17:04 ghost-in-the-zsh

Yes I'm using tmux inside of kitty

durka avatar Apr 10 '25 17:04 durka

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:

Image

After scrolling:

Image

FelixLisczyk avatar Apr 29 '25 15:04 FelixLisczyk

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:

Image

to this:

Image

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.

philippgille avatar Aug 19 '25 09:08 philippgille