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
what do you mean with default? Terminal? Gui? what is the background color? In the terminal, for how many colors is it configured?
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.
and what does :set t_Co? background? say?
With Putty: t_Co=8, background=light
Closed #2044.
But the problem still exists: if a user is using a dark background, they must manually :set background=dark
I think there is no way for vim to query the background color. So the user has to make sure to configure it correctly.
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.
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.
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)
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).
Could the patch include terminals which do report their capabilities correctly? gnome-terminal is very common and lots of people change the default background.
Are the Putty developers aware of the bug? Then they can fix it instead of you!
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?
I can't test with the newest putty or vim at the moment :(
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.![]()