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

Icons rendered small on Kitty due to following nbsp #916

Closed
1 task done
Bekaboo opened this issue Oct 24, 2023 · 2 comments
Closed
1 task done

Icons rendered small on Kitty due to following nbsp #916

Bekaboo opened this issue Oct 24, 2023 · 2 comments
Labels
question Further information is requested

Comments

@Bekaboo
Copy link
Contributor

Bekaboo commented Oct 24, 2023

Info

  • Operating System: Linux 6.1.58-1-lts
  • Shell: fish
  • Terminal: kitty 0.29.2 + tmux 3.3a
  • nvim --version: NVIM v0.10.0-dev-1334+gd2d38858d1
  • fzf --version: 0.42.0 (d471067e)
  • The issue is reproducible with mini.sh
fzf-lua configuration
require('fzf-lua').setup({
})

Description

Icon rendered small on kitty terminal due to following nbsp.

See kovidgoyal/kitty#1463, kitty will only render icons as full-width when it is followed by at least on space.

Screenshots:

  • On kitty:

    image

  • Same tmux pane on alacritty:

    image

Setting opts.nbsp to plain space seems to fix this issue, but it will break the live_grep finder (e.g. cannot jump to the correct file and location), not sure if that breaks other functionalities.

Tried with opts.nbsp = ' \xe2\x80\x82' (space followed by nbsp), but that makes the gap between the icon and the text too large.

Could you help me figure out how can I have full-width nerd font icons on kitty without breaking existing functionalities? Thanks in advance!

kovidgoyal added a commit to kovidgoyal/kitty that referenced this issue Oct 24, 2023
… contains a non-breaking space as well as a normal space

There is some software out there that uses nbsp as a separator,
presumably as some kind of hack.

ibhagwan/fzf-lua#916
@ibhagwan
Copy link
Owner

Take a look at the default options section:

require('fzf-lua').setup {
  -- padding can help kitty term users with
  -- double-width icon rendering
  file_icon_padding = ' ',
}

@ibhagwan ibhagwan added the question Further information is requested label Oct 24, 2023
@Bekaboo
Copy link
Contributor Author

Bekaboo commented Oct 24, 2023

Thank you for your assistance! I attempted to adjust the opts.file_icon_padding, but encountered a similar issue when setting opts.nbsp to ' \xe2\x80\x82' – the space between the icon and the text appeared slightly too large.

I'm very grateful to @kovidgoyal for addressing this specific case in Kitty! With the recent patch he added, using kitty nightly now allows for a seamless full-width icon display, whether followed by a space or a nbsp. Now setting opts.nbsp to '\xc2\xa0' solves the issue.
Setting it other invisible values, e.g. '\xe2\x80\x82' (the default nbsp value) does not work, however, but it should be easy to solve.

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

No branches or pull requests

2 participants