-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
FZF colors no longer match your color scheme #1152
Comments
Works for me. |
I am windows 10 maybe that's why |
The code below looks redundant now " Customize fzf colors to match your color scheme |
What do you mean by "Latest update"? |
junegunn/fzf@7915e36, Sorry not sure what issue goes here or the other repo |
This reverts commit 7915e36 due to junegunn/fzf.vim#1152 (comment).
I see. I reverted the commit. /cc @wjrogers |
@kelleyma49 Hi, thanks for chiming in. The latest version of the Vim plugin runs fzf inside a popup window by default. If you don't use Vim at all and are not familiar with its plugin ecosystem. Here is an easy way to try it:
Since the Vim plugin determines the size of the popup window, it doesn't use |
After reading #1141, now I realized that the image you titled "After v0.24" is actually showing the right colors. The colors shown in "Before v0.18" are incorrect. So this is not an issue. |
Isn't setting g:fzf_colors supposed to match the vim colorscheme... If not how do you get FZF to match your colorscheme after 0.24 |
I don't have a Windows 10 PC to test this, so I can only guess. The colors in the first picture are not the default colors of fzf, which made me think that the variable was playing its part. However, it's indeed strange that the background color is not changed. A few things to check:
|
echo fzf#wrap().options shows: --color=bg+:236,bg:235,spinner:170,hl:59,fg:145,header:59,info:180,pointer:170,marker:204,fg+:145,prompt:170,hl+:170 The colors match what is in the terminal I am starting to think it is a limitation of the terminal? unletting g:fzf_colors matches my colorscheme slightly better Is this relevant: |
So these are 256 ANSI colors rather than 24-bit true colors,
and the difference you see (such as the background color) is due to the limitation of the 256-color palette. The latest version of fzf does support 24-bit colors on Windows, but the Vim plugin is not generating 24-bit colors according to This patch will make diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 14d0276..1eef9e3 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -303,7 +303,7 @@ function! s:common_sink(action, lines) abort
endfunction
function! s:get_color(attr, ...)
- let gui = !s:is_win && !has('win32unix') && has('termguicolors') && &termguicolors
+ let gui = has('gui_running') || has('termguicolors') && &termguicolors
let fam = gui ? 'gui' : 'cterm'
let pat = gui ? '^#[a-f0-9]\+' : '^[0-9]\+$'
for group in a:000 |
New output --color=bg+:#2C323C,bg:#282C34,spinner:#C678DD,hl:#5C6370,fg:#ABB2BF,header:#5C6370,info:#E5C07B,pointer:#C678DD,marker:#E06C75,fg+:#ABB2BF,prompt:#C678DD,hl+:#C678DD Yes, that change would fix the issue |
I can close this if you commit this change.... |
Unfortunately, it's not that simple. I have a Windows 2016 server and GVim running there does not properly display 24-bit colors in its terminal (it's probably a limitation of old cmd.exe) so this change makes the colors way worse.
/cc @janlazo |
From what I gather windows 10 terminals/consoles have had 24 bit color support by default since 2017. 2016 initial implementation. 2017 widespread support |
On Vim, there is If https://github.com/microsoft/terminal is the terminal for cmd.exe and powershell.exe on recent versions of Windows 10, then the earliest stable v1.x release is https://github.com/microsoft/terminal/releases/tag/v1.0.1401.0, released on May 19, 2020. |
@junegunn as an aside does GFiles? work on Windows 2016 server |
@blayz3r Yes, both |
I had a similar problem on Linux (Debian 10, KDE). In my terminal (Konsole), everything worked as expected, but in GVim, the colors didn't match the color scheme (as in your screenshot above). After setting ...
... in my |
I'm on Mac and not sure if this is related, but I run let $FZF_DEFAULT_COMMAND = 'fd --type f --hidden --follow --color=always -E .git --ignore-file ~/.gitignore' Since updating to the latest version today e9d62b4, all colors started looking off: |
Try starting a terminal buffer and run fzf there. :term
echo $TERM
fzf
|
@junegunn Thank you so much! You are correct the issue was caused due to a PR on my colorscheme that removed those |
So this issue can be closed if we add the above condition to: function! s:get_color(attr, ...)
- let gui = !s:is_win && !has('win32unix') && has('termguicolors') && &termguicolors
+ let gui = has('gui_running') || has('termguicolors') && &termguicolors
let fam = gui ? 'gui' : 'cterm'
let pat = gui ? '^#[a-f0-9]\+' : '^[0-9]\+$'
for group in a:000 |
This reverts commit 7915e36 due to junegunn/fzf.vim#1152 (comment).
It seems that this is blocked by a need to maintain compatibility with |
For Windows GVim users, I could fix the issue with these 2 options: set termwintype=conpty
let g:fzf_force_termguicolors = 1 Also if you want the embedded terminal to match your color scheme add this: highlight! link Terminal Normal |
Just leaving a note here regarding the above comment about using conpty, on my machine (Windows 11) doing a This is an issue in vim and not fzf.vim: vim/vim#12438 (comment) |
man fzf
)After v0.24
Before v0.18
The text was updated successfully, but these errors were encountered: