-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Setting fish_term24bit
to 1
breaks colors in neovim terminal
#2600
Comments
Thanks for the report! I don't understand what the issue is however. Is it that neovim has its own terminal emulator, but it's picking up environment variables from the "root" terminal emulator, and therefore fish thinks 24 bit color is supported? |
@raichoo: Is this still your nvimrc? What's your config.fish?
Last I heard and when I just tested it, nvim assumes the shell is sh-compatible, so you'd have The reason I'm asking is because it seems nvim inheriting fish_term24bit breaks stuff, which is weird because to nvim it should just be another environment variable that it shouldn't care about. So it seems it's running fish somewhere which is known to cause issues. |
I just tried that nvimrc verbatim, and it works for me. So I'd like to take a look at your config.fish now. Also, what is your terminal emulator? |
@ridiculousfish: I've turned on true color support for |
@raichoo, take a look at https://gist.github.com/XVilka/8346728 to make sure you have true colors support in terminal in order to use true colors in |
I have true color support. It's the built in terminal of |
@raichoo: Again, what is in your config.fish? I've ran ":terminal" in nvim, which then launched an embedded fish, with your exact nvimrc (at least what you have uploaded to github) and it worked. (This is with neovim 0.1.1 in konsole 15.08.3 on archlinux) |
@raichoo: Ping? |
Not sure if it is the right place as I'm just discovering fish. |
@rakr, if the terminal is detected to support true colors (by You can actually use |
@pickfire, You said
As far as I can tell that is not true. Fish will, however, automatically set fish_term256 based on $TERM. See function update_fish_color_support in input.cpp. |
@krader1961: https://github.com/fish-shell/fish-shell/blob/master/share/functions/__fish_config_interactive.fish#L289-L296. It's a hack, but it's the best we can do. I'll have to recheck which of those cases is true in nvim's terminal. |
Ah, yes, I was only looking at the core C++ code, @faho, and had forgotten about that recent addition to the interactive function. But that raises the question of whether we should move the equivalent logic for setting fish_term256 out of the C++ update_fish_color_support function and into that fish script function. @raichoo, can you tell us what the values of the following env vars are inside your neovim terminal: KONSOLE_PROFILE_NAME, ITERM_SESSION_ID, TERM, VTE_VERSION, COLORTERM? |
Urgh, I've found the issue. neovim's terminal swallows the 24bit sequences without interpreting them, even in a terminal. That means e.g. The reason I didn't see that is because fish still sends the old-school sequences for named colors (
TERM is set to xterm-256color, the rest seem to be inherited from the environment. There's also a $NVIM_LISTEN_ADDRESS set. There's a few ways to deal with it:
Of those, I like the last the most, though it's possible neovim GUIs also set that and do interpret the 24bit sequences properly, I consider (and this was a major goal of that way of enabling 24bit) it more important that nothing gets the colors wrong than that everything gets the colors right. |
Great thanks |
I just wanted to report this so that fellow
neovim
users might know what it going on.Commit
b73bf53bd30cb8b6056888a473368968041dbe66
setsfish_term24bit
to1
ontruecolor
terminals. This breaks my highlighting inneovim
like so:What I'm expecting is something like this:
I work around this issue by putting something along these lines into my
config.fish
.It's a little bit of a hack but does the job.
Kind regards,
raichoo
The text was updated successfully, but these errors were encountered: