Describe the bug
The colors used inside :terminal
do not seem to match the colors used from a normal shell.
To Reproduce
Detailed steps to reproduce the behavior:
bat
bat path/to/some/code/file
inside your shell:terminal
bat path/to/some/code/file
inside your :terminal
windowExpected behavior
The two file previews should look identical
Screenshots
On the right, this is what bat shows when run from a shell:
On the right, that is what bat shows when run from a vim :terminal
:
Environment (please complete the following information):
Additional context
I use bat with the default
theme, which from their source code, should be Monokai Extended
.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
I use a test file to check that the colors are exactly the same. Most likely there is something in your setup that isn't quite right.
Hm, perhaps the windows default terminal is buggy? There is a known problem #5092, perhaps its the same?
Color problems have been recognized for some time and patches have been written.
I was checking the operation in my real environment.
A similar problem has now been noticed as it has moved away from PC life.
Oh, you are using an MS-Windows console to run a terminal in? Obviously this has restrictions, since a terminal window is made to run in a terminal (such as xterm), a console in MS-Windows doesn't have nearly the kind of support needed for that. The ConPTY stuff is supposed to make it work, but there are bugs...
I was able to reproduce it. The display will be crushed. It wasn't just the color difference.
I will do my best to resolve it.
Maybe ConPTY's device detection '^[[0c' and winpty features are mixed.
'vim -u NONE' starts winpty, ConPTY reports as VT101, bat seems it and outputs in ANSI color.
"vim -u NONE -c 'set termwintype=conpty'" 's :terminal is no color, right.
notermguicolors, t_Co=16 is originally a 16-color palette, and colors are output using the API.
For now, use ConPTY's :terminal. However, not all will be solved.
The line next to the ruled lines becomes trashy, which requires a retest.
Line breaks don't work, this requires additional testing.
Thank you so much!
I didn't know about termwintype.
Thanks again!
Thank you for your report!
I am very encouraged.
Now, ruled lines, the so-called ambiwidth problem. A destructive display in my environment. This does not solve cleanly.
probably it do had a issue, i was thinking if that's a bug also, though maybe not same issue like here.
for example: yellow '^[[1;33mtest' that's a different color in my xfce-term and :term in vim.
but problem maybe just about highlight or bold of one color.
The color is different between the newly installed Windows 10 terminal and the Windows 10 terminal updated from the previous Windows. Incredible.
Color development is a heavy issue. I care and do my best.
um, that issue said actually not specific to windows, but linux also, probably mac same.
just a fyi to @brammool , it did not impact sth, but just the color looks different between :term of vim and outside.
as for issue this ticket saying, pls keep going, sorry jump in.. :)
There is also such a thing.
#5359
I read the source code. Vim script is easier to implement. Well...
@ntak vim script sometime was not the best option either :)
compiled within vim itself sometime can avoid sth .. just jumped such out of my mind.
you are doing great.
I have tuned the behavoir of the terminal window using src/testdir/color_ramp.vim. That works perfectly in an xterm now: "cat testdir/color_ramp.txt" shows the same colors at the shell prompt as inside a terminal window. Since the terminal window uses an xterm-like terminal this is possible, for Windows it will be more tricky. But we can try.
those looks for 256 colors, but for palette - looks some term has its own setting.
anyway, to my issue i bring up here, i found it caused by my term has a option to switch bold to bright.
that's why color looks was not its intact one. @brammool gave me some tips.
I am using ntak's fix for now (set termwintype=conpty
from this comment) and though the colors are fixed, I find myself unable to use arrows, home and end keys.
I can confirm that removing set termwintype=conpty
gives me back support of arrows, and keys.
I'm using gvim v8.2.1127 on Windows10, with the vifm.vim
plugin:
set termwintype=
with ability to use <up>, <down>, <left>, <right>, <home> and <end> but incorrect colorsset termwintype=conpty
with correct colors but <up>, <down>, <left>, <right>, <home> and <end> don't seem to respondAny news on this issue?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
My issue may be unrelated as windows is being discussed here and I'm on macOS, but my colors are also not as would seem correct.
I have set termguicolors
in my .vimrc
and I am also seeing issue with the way colors are working for :terminal
right now. I am using iterm2 and this version of vim:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 19 2022 18:24:48)
macOS version - x86_64
I also have export TERM=xterm-256color
in my .bashrc
.
I'll use neofetch to show color examples, since it outputs the main terminal colors.
This is just my normal BASH config in iterm2:
I moved my actual .vimrc
out of the way so I could test with the minimal settings you see on the right side of each image below.
This is without set termguicolors
, which fixes the shell, but breaks my vim colorscheme:
This is with set termguicolors
, which fixes my vim colorscheme, but breaks the :terminal
colors:
Perhaps I am just doing something wrong, or there is an additional setting I should be aware of?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Can I ask what happens after you exit vim, but stay in the same terminal session? Does vim then correctly restore the terminals colors to what they were previously, or do they stay different until you restart the terminal?
I'm thinking it maybe similar to what i'm fixing for windows. In windows, Vim tries to get the terminals default color table (the colors mapped to the standard 16 ansi color names), and then change that table while vim is running, and then tries to restore it on exit. This fails on the new windows terminal, because windows has changed how they reports the colortable - it doesnt mean the same thing anymore as it used to in the old command prompt console.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Perhaps I am just doing something wrong, or there is an additional setting I should be aware of?
With termguicolors
, vim uses g:terminal_ansi_colors
variable to set up 16 colors of built-in terminal. If you (or your colorscheme) didn't set it up, then I guess some default hardcoded values are used.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.