Open MarcoBuess opened 1 month ago
I just tested devicons.get_icon_by_filetype(vim.bo.filetype)
which is returning the correct icon/highlight group while in the affected buffer.
So the problem lies somewhere here: https://github.com/nvim-lualine/lualine.nvim/blob/0a5a66803c7407767b799067986b4dc3036e1983/lua/lualine/components/filetype.lua#L34C34-L34C73
Lines 35-37
would potentially recover the problem but don't get triggert as icon != null
. Any particular reason why getting the icon like that instead of just using vim.bo.filetype
in general? vim.bo.filetype
would also kinda allow the users to make small modifications by changing a buffers file type, which might be a good thing?
Seems like @arsmoriendy already found the same thing and filed a PR: https://github.com/nvim-lualine/lualine.nvim/pull/1252
Unfortunately some of my tests failed. One of the reason being that the filetype component test only simulates the buffer's filename and not the filetype (line 303 in component_spec.lua
) . I will try to look further into it this weekend.
Self Checks
0a5a668
How to reproduce the problem
Launching a terminal with
term
and thus startingvim.opt.shell
will result in this filetype icon.Expected behaviour
Launching a terminal with
term pwsh
will yield the expected result.I don't quite get the difference other than that
term pwsh
will spawn 2 instances ofpwsh
as oppsed toterm
which will spawn just one instance ofpwsh
. In both casesfiletype
will be set toterminal
by an autocommand. I tried several filetypes in theterm
session, but the icon didn't change. It also behaves the same for me no matter what shell you set. I even triedcmd
.Minimal config to reproduce the issue
Additional information
OS: Windows 11 (10.0.22631) Neovim: v0.10.0, Release, LuaJIT 2.1.1713484068 lualine:
0a5a668
Terminal: Windows Terminal v1.20.11381.0