Something wrong with the vim colorshemes #9387

Open
opened 2026-01-31 01:53:17 +00:00 by claunia · 7 comments
Owner

Originally created by @aeilot on GitHub (Jul 2, 2020).

Environment

Windows build number:  10.0.19042.0
Windows Terminal version (if applicable): 1.0.1811.0
VIM: 8.2

Steps to reproduce

I installed onedark.vim colorscheme for vim.

But the colorscheme doesn't work correctly as I saw on my Mac.

By the way, I am using the Terminal colorscheme snazzy.

Here's it's config:

		{
				"name": "Snazzy",
				"black": "#000000",
				"red": "#fc4346",
				"green": "#50fb7c",
				"yellow": "#f0fb8c",
				"blue": "#49baff",
				"purple": "#fc4cb4",
				"cyan": "#8be9fe",
				"white": "#ededec",
				"brightBlack": "#555555",
				"brightRed": "#fc4346",
				"brightGreen": "#50fb7c",
				"brightYellow": "#f0fb8c",
				"brightBlue": "#49baff",
				"brightPurple": "#fc4cb4",
				"brightCyan": "#8be9fe",
				"brightWhite": "#ededec",
				"background": "#1e1f29",
				"foreground": "#ebece6"
		}
	        "acrylicOpacity": 0.7,
                "colorScheme" : "Snazzy",
                "cursorColor" : "#000000",
                "fontFace" : "MesloLGL Nerd Font",
                "useAcrylic": true

Expected behavior

This is what onedark.vim really looks like:

Actual behavior

But it looks like this here:
image

Originally created by @aeilot on GitHub (Jul 2, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.19042.0 Windows Terminal version (if applicable): 1.0.1811.0 VIM: 8.2 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> I installed [onedark.vim](https://github.com/joshdick/onedark.vim) colorscheme for vim. But the colorscheme doesn't work correctly as I saw on my Mac. By the way, I am using the Terminal colorscheme `snazzy`. Here's it's config: ```json { "name": "Snazzy", "black": "#000000", "red": "#fc4346", "green": "#50fb7c", "yellow": "#f0fb8c", "blue": "#49baff", "purple": "#fc4cb4", "cyan": "#8be9fe", "white": "#ededec", "brightBlack": "#555555", "brightRed": "#fc4346", "brightGreen": "#50fb7c", "brightYellow": "#f0fb8c", "brightBlue": "#49baff", "brightPurple": "#fc4cb4", "brightCyan": "#8be9fe", "brightWhite": "#ededec", "background": "#1e1f29", "foreground": "#ebece6" } ``` ```json "acrylicOpacity": 0.7, "colorScheme" : "Snazzy", "cursorColor" : "#000000", "fontFace" : "MesloLGL Nerd Font", "useAcrylic": true ``` # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> This is what `onedark.vim` really looks like: ![](https://raw.githubusercontent.com/joshdick/onedark.vim/master/img/readme_header.png) # Actual behavior <!-- What's actually happening? --> But it looks like this here: ![image](https://user-images.githubusercontent.com/25583228/86315265-49d60f80-bc5c-11ea-83a9-532e27284362.png)
claunia added the Issue-BugPriority-3Area-VTResolution-ExternalProduct-Terminal labels 2026-01-31 01:53:17 +00:00
Author
Owner

@DHowett commented on GitHub (Jul 3, 2020):

This is a version of #293 that is not fixed by #6698 #6506. vim.exe achieves setting this "background" by explicitly redefining what the console color at index 0 means. This is actually worse after #6506 because we're better about exposing the drawing operations of the application to the terminal, and we still believe console color 0 to be the "background". When an application uses the legacy console API to set the colors, we drop the background and foreground out so the acrylic can shine through.

This is very dangerously close to acting by design and might need a fix in vim.exe.

@DHowett commented on GitHub (Jul 3, 2020): This is a version of #293 that is not fixed by #6698 #6506. _vim.exe_ achieves setting this "background" by _explicitly redefining what the console color at index 0 means_. This is actually _worse_ after #6506 because we're better about exposing the drawing operations of the application to the terminal, and we still believe console color 0 to be the "background". When an application uses the legacy console API to set the colors, we drop the background and foreground out so the acrylic can shine through. This is very dangerously close to acting by design and might need a fix in vim.exe.
Author
Owner

@gordonmessmer commented on GitHub (Jul 5, 2020):

Is there a preview build that includes 6698 and 6506?

@gordonmessmer commented on GitHub (Jul 5, 2020): Is there a preview build that includes 6698 and 6506?
Author
Owner

@zadjii-msft commented on GitHub (Aug 4, 2020):

@gordonmessmer at this point, the 1.2 preview should be out that includes those changes.

@zadjii-msft commented on GitHub (Aug 4, 2020): @gordonmessmer at this point, the 1.2 preview should be out that includes those changes.
Author
Owner

@zadjii-msft commented on GitHub (Aug 4, 2020):

I'm thinking that we might be able to fix this if we had conpty listen for changes to the color table, and emit those with the OSC sequences for setting the color table. I don't think this is the right solution - vim.exe could definitely just fix this on their end. But this is an option that's available to us

@zadjii-msft commented on GitHub (Aug 4, 2020): I'm thinking that we might be able to fix this if we had conpty listen for changes to the color table, and emit those with the OSC sequences for setting the color table. I don't think this is the _right_ solution - `vim.exe` could definitely just fix this on their end. But this is an option that's available to us
Author
Owner

@aeilot commented on GitHub (Aug 5, 2020):

Thanks for replying!

On KDE, the Yakuake Terminal, which also contains the feature of acrylic, does like this:

Screenshot_20200805_115116

Screenshot_20200805_114830

On Mac, it looks like this as well.

Maybe we can do as they do. What I think about it is, when the user opens special apps like vim, we can disable this feature or etc.

@aeilot commented on GitHub (Aug 5, 2020): Thanks for replying! On KDE, the Yakuake Terminal, which also contains the feature of `acrylic`, does like this: ![Screenshot_20200805_115116](https://user-images.githubusercontent.com/25583228/89369913-fd299c80-d711-11ea-8695-f53827c99207.png) ![Screenshot_20200805_114830](https://user-images.githubusercontent.com/25583228/89369852-d53a3900-d711-11ea-849a-d64bf7d23fbf.png) On Mac, it looks like this as well. **Maybe we can do as they do.** What I think about it is, when the user opens special apps like vim, we can disable this feature or etc.
Author
Owner

@DHowett commented on GitHub (Aug 5, 2020):

This is because on those platforms Vim uses VT sequences, but on Windows it does not. If you use Vim inside WSL you can see that it will work the same way 😄

@DHowett commented on GitHub (Aug 5, 2020): This is because on those platforms Vim uses VT sequences, but on Windows it does not. If you use Vim inside WSL you can see that it will work the same way :smile:
Author
Owner

@j4james commented on GitHub (Aug 9, 2020):

I'm thinking that we might be able to fix this if we had conpty listen for changes to the color table, and emit those with the OSC sequences for setting the color table.

I don't think this will help. I wrote a patch to fix issue #2985 that does something like this, and it makes no difference to vim. The underlying problem is that the console API can't differentiate between a black background and default, so we treat them as the same thing (that is they're both interpreted as default). So it doesn't matter what the palette color for black is set to - a black background is still going to be interpreted as default, and thus will always be transparent (if you have acrylic enabled).

@j4james commented on GitHub (Aug 9, 2020): > I'm thinking that we might be able to fix this if we had conpty listen for changes to the color table, and emit those with the OSC sequences for setting the color table. I don't think this will help. I wrote a patch to fix issue #2985 that does something like this, and it makes no difference to vim. The underlying problem is that the console API can't differentiate between a black background and default, so we treat them as the same thing (that is they're both interpreted as default). So it doesn't matter what the palette color for black is set to - a black background is still going to be interpreted as default, and thus will always be transparent (if you have acrylic enabled).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9387