[vim/vim] Could the default colorscheme for vimdiff be changed to something more readable? (#2044)

90 views
Skip to first unread message

macau23

unread,
Sep 1, 2017, 3:37:26 AM9/1/17
to vim/vim, Subscribed

I don't think I have ever met anyone who can read a vimdiff using the default color scheme. At least one of them was seriously hospitalized due to eye strain. Could the default color scheme for vimdiff be changed to something more readable, like murphy?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Christian Brabandt

unread,
Sep 1, 2017, 5:42:07 AM9/1/17
to vim/vim, Subscribed

what do you mean with default? Terminal? Gui? what is the background color? In the terminal, for how many colors is it configured?

macau23

unread,
Sep 4, 2017, 3:21:56 AM9/4/17
to vim/vim, Subscribed

I am using gnome-terminal under Fedora which has a black background. $TERM says xterm-256color
On Windows I am using Putty which has a black background. $TERM says xterm.

Christian Brabandt

unread,
Sep 4, 2017, 3:32:27 AM9/4/17
to vim/vim, Subscribed

and what does :set t_Co? background? say?

macau23

unread,
Sep 5, 2017, 8:18:00 AM9/5/17
to vim/vim, Subscribed

With Putty: t_Co=8, background=light

Christian Brabandt

unread,
Sep 5, 2017, 8:54:09 AM9/5/17
to vim/vim, Subscribed
There you have it. Change your background to dark and possibly also set t_Co=256

That should make it readable.

> Am 05.09.2017 um 14:17 schrieb macau23 <notifi...@github.com>:
>
> With Putty: t_Co=8, background=light
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.

Christian Brabandt

unread,
Sep 5, 2017, 10:05:34 AM9/5/17
to vim/vim, Subscribed

Closed #2044.

macau23

unread,
Sep 5, 2017, 10:25:13 AM9/5/17
to vim/vim, Subscribed

But the problem still exists: if a user is using a dark background, they must manually :set background=dark

Christian Brabandt

unread,
Sep 5, 2017, 10:46:55 AM9/5/17
to vim/vim, Subscribed

I think there is no way for vim to query the background color. So the user has to make sure to configure it correctly.

macau23

unread,
Sep 7, 2017, 5:05:05 AM9/7/17
to vim/vim, Subscribed

Doesn't vim guess using term_bg_default() in module option.c?

Maybe the xterm control sequence \e]11;?\a would be a better way.

Ref: https://stackoverflow.com/questions/2507337/is-there-a-way-to-determine-a-terminals-background-color#7767891

Kazunobu Kuriyama

unread,
Sep 7, 2017, 5:25:12 AM9/7/17
to vim/vim, Subscribed

Maybe the xterm control sequence \e]11;?\a would be a better way.

Unfortunately, through the discussions on terminal capabilities we have had for these days, it is now clear to us that putty is one of terminals which are not so xterm-compatible as they claim via their $TERM value.

If the terminal responded to the control sequence correctly, Vim could know its background color and hence automatically set 'background' to the correct value.

Christian Brabandt

unread,
Sep 7, 2017, 6:44:32 AM9/7/17
to vim/vim, Subscribed

yes, putty does not understand that as a quick test shows. Perhaps we can guess that putty will by default have a dark background however (at least if $TERM is set to putty or so)

Christian Brabandt

unread,
Sep 7, 2017, 6:50:03 AM9/7/17
to vim/vim, Subscribed

So how about this patch:

diff --git a/src/option.c b/src/option.c
index a1304c944..4a1d38654 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4043,7 +4043,7 @@ term_bg_default(void)
     if (STRCMP(T_NAME, "linux") == 0
            || STRCMP(T_NAME, "screen.linux") == 0
            || STRCMP(T_NAME, "cygwin") == 0
-           || STRCMP(T_NAME, "putty") == 0
+           || STRNCMP(T_NAME, "putty", 5) == 0
            || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL
                && (p = vim_strrchr(p, ';')) != NULL
                && ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')

(I usually run my putty with $TERM set to putty-256color, which is not caught by the current check).

macau23

unread,
Sep 7, 2017, 8:34:38 AM9/7/17
to vim/vim, Subscribed

Could the patch include terminals which do report their capabilities correctly? gnome-terminal is very common and lots of people change the default background.

macau23

unread,
Sep 7, 2017, 8:35:15 AM9/7/17
to vim/vim, Subscribed

Are the Putty developers aware of the bug? Then they can fix it instead of you!

bam80

unread,
Mar 5, 2019, 9:48:05 AM3/5/19
to vim/vim, Subscribed

Are the Putty developers aware of the bug? Then they can fix it instead of you!

I've emailed them, will see.
By the way, does it still an issue with putty?

macau23

unread,
Jun 6, 2019, 6:24:21 AM6/6/19
to vim/vim, Subscribed

I can't test with the newest putty or vim at the moment :(

nikolas

unread,
9:56 AM (3 hours ago) 9:56 AM
to vim/vim, Subscribed
nikolas left a comment (vim/vim#2044)

This remains an issue with modern terminal emulators such as foot, and maybe others. Was there ever any progress on this committed to git? Maybe this issue can be re-opened.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2044/4833369412@github.com>

Reply all
Reply to author
Forward
0 new messages