Skip to content
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

Lines not flushed correctly in presence of emoji #3558

Closed
5 of 10 tasks
postsolar opened this issue Jan 1, 2024 · 2 comments
Closed
5 of 10 tasks

Lines not flushed correctly in presence of emoji #3558

postsolar opened this issue Jan 1, 2024 · 2 comments
Assignees
Labels

Comments

@postsolar
Copy link

postsolar commented Jan 1, 2024

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

There's #2482 which was closed more than 2 years ago but I'm having a very similar issue on 0.45 (devel):

image

If I pass a list of lines containing emoji characters to fzf, last characters of some lines would "stick" to their position and won't get cleared after scrolling a line.

Terminal: foot version: 1.16.2-8-gca46edfe (Nov 10 2023, branch 'master') +pgo +ime +graphemes -assertions, although it also happens in alacritty, contour, kitty, urxvt, wayst and wezterm.

To reproduce:
Just get a list of emojis and their description, the one from #2482 works too.

curl -s https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.local/share/larbs/emoji | FZF_DEFAULT_OPTS= fzf

Simply scroll up / down.

@junegunn
Copy link
Owner

junegunn commented Jan 4, 2024

Possibly related: mattn/go-runewidth#59

@junegunn junegunn added the bug label Jan 4, 2024
@junegunn
Copy link
Owner

junegunn commented Jan 4, 2024

This fixes the issue.

diff --git a/go.mod b/go.mod
index ca3ebb9..4748c33 100644
--- a/go.mod
+++ b/go.mod
@@ -11,6 +11,8 @@ require (
 	golang.org/x/term v0.15.0
 )
 
+replace github.com/mattn/go-runewidth => github.com/rivo/go-runewidth v0.0.5-0.20220930163941-bb452aeec220
+
 require (
 	github.com/gdamore/encoding v1.0.0 // indirect
 	github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
diff --git a/go.sum b/go.sum
index d9bb109..30e1525 100644
--- a/go.sum
+++ b/go.sum
@@ -10,6 +10,8 @@ github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWV
 github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
 github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
+github.com/rivo/go-runewidth v0.0.5-0.20220930163941-bb452aeec220 h1:VZj/fDMXzsgaTZoTXENEis7i6S21rEHd5G1bdX7FG0M=
+github.com/rivo/go-runewidth v0.0.5-0.20220930163941-bb452aeec220/go.mod h1:bAEBv7vCrBnXArQn+ye99OGTAUaZLSEzHQNPaQ/k2w0=
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
 github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants