Truecolor works just out of the box within the terminal emulator of my choice - st by suckless. Neovim looks perfect. However, I've recently noticed that :set termguicolors breaks the colors in Vim. I've reproduced the issue without .vimrc by running :termguicolors and then :hi! LineNr ctermfg=red ctermbg=red guifg=red guibg=red or any other highlight group. With truecolor ready colorschemes, such as solarized8 or gotham256, I get only white text over my terminal's default background.
:help
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 21 2016 12:29:10)
Included patches: 1-2232
Compiled by Arch Linux
Huge version without GUI. Features included (+) or not (-):
+acl +dialog_con +job +mouse_sgr +rightleft +user_commands
+arabic +diff +jumplist -mouse_sysmouse +ruby +vertsplit
+autocmd +digraphs +keymap +mouse_urxvt +scrollbind +virtualedit
-balloon_eval -dnd +lambda +mouse_xterm +signs +visual
-browse -ebcdic +langmap +multi_byte +smartindent +visualextra
++builtin_terms +emacs_tags +libcall +multi_lang +startuptime +viminfo
+byte_offset +eval +linebreak -mzscheme +statusline +vreplace
+channel +ex_extra +lispindent +netbeans_intg -sun_workshop +wildignore
+cindent +extra_search +listcmds +num64 +syntax +wildmenu
+clientserver +farsi +localmap +packages +tag_binary +windows
+clipboard +file_in_path +lua +path_extra +tag_old_static +writebackup
+cmdline_compl +find_in_path +menu +perl -tag_any_white +X11
+cmdline_hist +float +mksession +persistent_undo -tcl +xfontset
+cmdline_info +folding +modify_fname +postscript +termguicolors -xim
+comments -footer +mouse +printer +terminfo -xpm
+conceal +fork() -mouseshape +profile +termresponse +xsmp_interact
+cryptv +gettext +mouse_dec +python +textobjects +xterm_clipboard
+cscope -hangul_input +mouse_gpm -python3 +timers -xterm_save
+cursorbind +iconv -mouse_jsbterm +quickfix +title
+cursorshape +insert_expand +mouse_netterm +reltime -toolbar
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, .![]()
Did you get that behaviour only with the mentioned color schemes (note that “true-color ready” essentially just means that guibg and guifg are defined also in terminal Vim)? I cannot reproduce what you describe with Vim 7.4 1-2210 and iTerm2. Is it any different with :hi! LineNr guifg=#ff0000 guibg=#ff0000?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.![]()
Btw, are you running Vim inside tmux? In which case, you should most likely have to set t_8f and t_8b (see :h xterm-true-color).
No, the issue occurs outside tmux. Nothing has changed by using a HEX value.
What if you set t_8f and t_8b anyway as explained in the manual?
By applying termguicolors and the following snippet (before a colorscheme has been set):
set t_8f=^[[38;2;%lu;%lu;%lum
set t_8b=^[[48;2;%lu;%lu;%lum
I get only escape sequences drawn on my screen.
You should input actual escape for ^[.
Use <Ctrl-V><Esc> to input actual escape.
What exactly do you mean? <C-v><ESC> returns only ^[.
—
You are receiving this because you are subscribed to this thread.
If the ^[ is two characters (^ and [), it's wrong. If it is one character, it's okay.
When you delete the character with backspace, you will find that ^[ is deleted at once.
Please also check :help c_CTRL-V (and :help i_CTRL-V).
—
You are receiving this because you commented.
@vim-ml, yes ^[ is a single character. I've already said that I'm not running Vim inside tmux, but simply a terminal emulator that has truecolor support (it has been troubleshooted already). I believe that $TERM must be set to st-256color. If tmux has been started, it must be screen-256color. Can't check right now. In any case, my terminal reports that it has truecolor enabled and Neovim works just out of the box.
—
You are receiving this because you were mentioned.
—
You are receiving this because you are subscribed to this thread.
I think that the suckless community has implemented truecolor in st a few years ago. It's not related to my terminal. The problem also exists in xterm.
—
You are receiving this because you were mentioned.
Well, for what it's worth, I cannot reproduce the issue with the steps mentioned at the first message. For me, this works. Sorry, for not being able to help.
—
You are receiving this because you were mentioned.
True colors also works for me both inside as well as outside tmux. I'm using the development version of the xfce4-terminal emulator, which supports true colors. My only issue is with transparent background as mentioned on issue #981. There I also detail how I have correctly setup vim to get true colors.
—
You are receiving this because you were mentioned.
Just came across this while updating my config to move away from my custom 24bit-color-capable build of Vim. With st 0.7-1 on Arch Linux, and with the latest version from git://git.suckless.org/st (currently: 68bae9c), termguicolors seems to work fine, provided you add the Vim-specific &t_8f and &t_8b terminal settings.
I really hate using raw escapes with :set (as in the comment above), due to the ambiguous ^[-but-really-^[-and-not-^-followed-by-[ that several people tried to explain. Here's what I added to my vimrc (before setting a colorscheme) to get things working:
" set Vim-specific sequences for RGB colors let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
(The characters after the %s are lowercase Ls.)
FWIW, I tested gotham and gotham256 from https://github.com/whatyouhide/vim-gotham and solarized8_dark and solarized8_dark_high from https://github.com/lifepillar/vim-solarized8. All seemed to produce colors that looked like the examples on vimcolors.com. My $TERM setting is st-256color, ATM.
—
You are receiving this because you were mentioned.
Thanks a lot, @benizi! Your solution has fixed my issue. Can't believe it was that simple...
—
You are receiving this because you were mentioned.
@benizi nice catch. it fix my issue with true colors
—
You are receiving this because you were mentioned.
I need to thank @benizi for this response. Thanks to you, I finally got my TermGUIColors working! Thank you so much, man!!!
—
You are receiving this because you were mentioned.
I know this is a junky work around on an old thread but since transparency works once vim has started for some, I added set the highlight command to an auto command on vim enter which works with my gruvbox colorshceme set up.
autocmd VimEnter * hi! Normal guibg=NONE
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
@benizi 2021 Fix still going strong! 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Btw, are you running Vim inside tmux? In which case, you should most likely have to set
t_8fandt_8b(see:h xterm-true-color).
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.![]()
FYI, the ugly kludge still works wonders ;-)) with Vim 9.0.813 and Tmux 3.3a on Gnome-Terminal 3.46.4.
It's even referenced in the troubleshooting section of this Archlinux wiki !
—
Reply to this email directly, view it on GitHub.
You are receiving this because you were mentioned.![]()