fzf icon indicating copy to clipboard operation
fzf copied to clipboard

[Bug] Last character leaves a trail when scrolling the list with .Xresource based terminal

Open fsc0 opened this issue 1 year ago • 3 comments

Checklist

  • [X] I have read through the manual page (man fzf)
  • [X] I have searched through the existing issues
  • [X] For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.57.0

OS

  • [X] Linux
  • [ ] macOS
  • [ ] Windows
  • [ ] Etc.

Shell

  • [X] bash
  • [X] zsh
  • [X] fish

Problem / Steps to reproduce

This bug is reproducible with st, xterm, rxvt-unicode, But not with kitty, alacritty.

Did test with default .Xresource setting.

Tested on Void Linux 6.12.6_3.

img

fsc0 avatar Dec 26 '24 07:12 fsc0

dummy-UTF-8.txt

I did further research and realized the encoding of that dummy.txt on gif demo was UTF-8, And bug couldn't reproduce with ASCII.

img

EDIT: Upload dummy-UTF-8.txt

fsc0 avatar Dec 26 '24 08:12 fsc0

hny.txt

If the last character of the line is CJK character, bug can't reproduce. And the trail leaving the mark all over previous lines passed.

img

Related: #1526, #2020 Issue #2194, conditions are quiet different but quite similar.

EDIT: Further info

fsc0 avatar Dec 26 '24 08:12 fsc0

Thanks for the info @y0ast https://github.com/junegunn/fzf/issues/1526#issuecomment-835506019

https://github.com/junegunn/fzf/blob/fe3a9c603e924425f80b87d76adb3e80d2bc668c/src/terminal.go#L2174

t.window.CPrint(color, strings.Repeat(" ", 2 * fillSpaces)) 

https://github.com/junegunn/fzf/blob/fe3a9c603e924425f80b87d76adb3e80d2bc668c/src/terminal.go#L2188

t.window.Print(strings.Repeat(" ", 2 * fillSpaces))

But scrollbar not displaying properly, and layout broken with some options like header.

fsc0 avatar Dec 27 '24 12:12 fsc0