Skip to content

nvim-web-devicons make other plugins bugged with floating texts #271

Closed

Description

@hilmiwicak

Image / video that shows the bug

Here below is telescope with nvim-web-devicons
telescope with nvim-web-devicons

Below is telescope without nvim-web-devicons
telescope without nvim-web-devicons

Steps to reproduce

  1. Copy init.lua below
Click to expand init.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable",
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  { "nvim-lua/plenary.nvim", },
  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
    config = function ()
      local telescope_action_layout = require("telescope.actions.layout")

      require("telescope").setup({
        defaults = {
          initial_mode = "insert",
          mappings = {
            n = {
              ["<M-/>"] = telescope_action_layout.toggle_preview,
            },
            i = {
              ["<M-/>"] = telescope_action_layout.toggle_preview,
            }
          },
          preview = {
            hide_on_startup = true,
            filesize_limit = 10,
            treesitter = true,
          }
        },
        fzf = {
          fuzzy = true,
          override_generic_sorter = true,
          override_file_sorter = true,
          case_mode = "smart_case",
        },
      })
    end,
  },

  {
    "kyazdani42/nvim-web-devicons",
    config = function()
      require("nvim-web-devicons").setup({
        default = true,
      })
    end,
  },
})
  1. nvim -u ~/nvim-test-config/init.lua
  2. let lazy install the plugins
  3. :Telescope find_files and see that there are some floating texts
  4. Comment nvim-web-devicons part of lazy setup
  5. Close nvim
  6. nvim -u ~/nvim-test-config/init.lua
  7. :Telescope find_files and there are no floating texts anymore

Activity

  1. scardenasb commented on May 16, 2023

    @scardenasb
    Contributor

    It seems to be because some icons code, it was happening to me with ".txt" icon, so I replaced it with the same icon but the version for mi os (unix), using:

    require("nvim-web-devicons").setup({
    	override_by_extension = {
    		["txt"] = {
    			icon = "",
    			color = "#89e051",
    			cterm_color = "113",
    			name = "Txt",
    		},
    	},
    })
  2. hilmiwicak commented on May 16, 2023

    @hilmiwicak
    Author

    Thank you for your reply @scardenasb ! I think this bug exist because tmux rendered it wrong. I just tried it outside tmux and it works just fine.

  3. nullwiz commented on May 21, 2023

    @nullwiz

    Thank you for your reply @scardenasb ! I think this bug exist because tmux rendered it wrong. I just tried it outside tmux and it works just fine.

    Can confirm, I was having a similar issue in nvim-tree, where characters just end up there. Without tmux, it works fine.

  4. alex-courtis commented on May 22, 2023

    @alex-courtis
    Member

    Great news!

  5. BartSte commented on Apr 22, 2024

    @BartSte
    Contributor

    Thank you for your reply @scardenasb ! I think this bug exist because tmux rendered it wrong. I just tried it outside tmux and it works just fine.

    Did you find a solution to make tmux render them correctly? Or did you just stop using tmux?

  6. alex-courtis commented on Apr 23, 2024

    @alex-courtis
    Member

    Check your terminal then $TERM

    The terminal you started tmux from must be able to render the icons. Check $TERM and test from outside of tmux.

    Test again from within tmux: what is the $TERM ?

  7. BartSte commented on Apr 23, 2024

    @BartSte
    Contributor

    @alex-courtis, thanks for your help.

    I encounter the issue when running: Alacritty on windows + WSL2 + tmux
    As expected, the issue does not exist when I run Alacritty on windows + WSL2 (without tmux).

    My $TERM without tmux is: xterm-256color.
    My $TERM with tmux is: tmux-256color.

    When setting up tmux, I followed neovim's recommendations.

    After doing some digging, I found a closed issue on the tmux repo suggesting the rendering issue was due to an issue with Window's ConPTY.

    Also, this reddit post exactly matches the issue I had. No one suggested a solution, unfortunately.

    Since only a small subset of the icons render incorrectly, the easiest workaround is to just replace those with other icons in my config.

    I guess this is not an issue that can be solved by this repo, but hopefully these posts can help others encountering the same issue.

  8. alex-courtis commented on Apr 23, 2024

    @alex-courtis
    Member

    Nice digging! Could I please ask you to post some of those icons? It will be a useful reference for others that will likely experience the same issue.

  9. BartSte commented on Apr 23, 2024

    @BartSte
    Contributor

    Here a video of the issue:

    • video

    I encountered the issue with the icons related to the following file extensions:

    • txt
    • svg
    • xml
    • xmll
    • xll
    • scm
    • smm
    • toml
    • docx
    • log
  10. BartSte commented on Apr 24, 2024

    @BartSte
    Contributor

    Oke I found the issue. I is indeed an issue with window's conpty. So for anyone encountering this issue, you need to make sure you have the latests version of conpty.dll and OpenConsole.exe, as is described in this post.

  11. alex-courtis commented on Apr 28, 2024

    @alex-courtis
    Member

    Great news.

    I'm not quite understanding the issue; can I please ask you to draft a section for README.md?

    A PR would be great.

    You can also use `get_icon_name_by_filetype(filetype)` to get the icon name associated with the filetype.
    
    ## Known Issues
    
    ### XXX Not Rendering In Alacritty On Windows (with tmux?)
    
    Ensure something something dll...
    
    ## Contributing
    
    PRs are always welcome! Please see [CONTRIBUTING](CONTRIBUTING.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions