junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
62.23k stars 2.35k forks source link

Search results overflow into search input field on some terminals when text contains emojis #2697

Open ibhagwan opened 2 years ago

ibhagwan commented 2 years ago

Info

Problem / Steps to reproduce

First discovered in: https://github.com/ibhagwan/fzf-lua/issues/275 and reproduced with the latest version of fzf 0.29.0 (dc975e8).

Copying some of the links from this comment by @akrifari for convinience.

Best explained by watching the recordings below, when the text contains emojis while using alacritty/neovim term the search results overflow the input field:

Note that this does work in a kitty terminal (in the shell, not inside neovim):

But given this also happens in alacritty outside the scope of the fzf-lua plugin I'm guessing this is either a terminal issue^1 or fzf issue, would love to hear your opinion if this can be mitigrated at the fzf level?

Text with emojis used in the recording ```markdown Sit quos enim architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem Sit quos enim architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem ๐Ÿ‘ง๐Ÿผ Sit quos enimo architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem Sit quos enim architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem Sit quos enim architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem ๐Ÿ‘ง๐Ÿผ Sit quos enimo architecto nobis quas. Sequi dicta aut totam debitis neque ipsa! Est corrupti ea dolorum molestias ea Totam magni magnam maxime optio incidunt? Ipsum sapiente recusandae animi voluptatem ```
junegunn commented 2 years ago

image

Looks like the emoji modifier is not properly handled, taking up extra space which is causing the overflow you see.

echo ๐Ÿ‘ง๐Ÿผ should only take up 2 columns