Skip to content

emoji in diff causes doubled characters #4347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
durka opened this issue Mar 1, 2025 · 6 comments
Open

emoji in diff causes doubled characters #4347

durka opened this issue Mar 1, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@durka
Copy link

durka commented Mar 1, 2025

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 durka added the bug Something isn't working label Mar 1, 2025
@durka
Copy link
Author

durka commented Mar 1, 2025

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.

@ChrisMcD1
Copy link
Contributor

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
Copy link
Contributor

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: #4247 (comment)

@ghost-in-the-zsh
Copy link

This issue might be a duplicate of #3811?

@durka
Copy link
Author

durka commented Apr 10, 2025

Yes I'm using tmux inside of kitty

@FelixLisczyk
Copy link

FelixLisczyk commented Apr 29, 2025

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

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

No branches or pull requests

4 participants