Description of problem: In Fedora 21 GNOME switched default terminal background to black. Linux VTs already have black background by default since the beginning of time. I'm quite aware that there's different default in e.g. xterm, and it's not possible to have a one-size-fits-all theme, however it would be nice if at least the Workstation spin looked sensible by default. Thank you!
vim-7.4.640-3.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/vim-7.4.640-3.fc22
Related to this change, I am now getting: % vi *.spec Error detected while processing /etc/vimrc: line 62: E488: Trailing characters: # rhbz 1159920 Press ENTER or type command to continue Perhaps wrong comment char in /etc/vimrc? ;)
Package vim-7.4.640-3.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing vim-7.4.640-3.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-2669/vim-7.4.640-3.fc22 then log in and leave karma (feedback).
This bug still affects AArch64. Despite the fixed version[1]: $ rpm -q vim-minimal vim-minimal-7.4.640-2.fc23.aarch64 I still notice `vim` fails with: $ vi foo.txt Error detected while processing /etc/virc: line 62: E488: Trailing characters: # rhbz 1159920 Press ENTER or type command to continue [1] arm.koji.fedoraproject.org/koji/buildinfo?buildID=263610
Package vim-7.4.640-4.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing vim-7.4.640-4.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-2669/vim-7.4.640-4.fc22 then log in and leave karma (feedback).
Hi, I was wondering if the rules for setting background for COLORTERM='gnome-terminal' could also be used for COLORTERM='rxvt-xpm' . The latter is what my COLORTERM is set to, and some text appears whited out. I'm guessing I could get by with modifying my COLORTERM to be gnome-terminal though I don't know offhand if that'll cause other problems. BTW, my terminal emulator is rxvt-unicode.
vim-7.4.640-4.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
I had this issue: $ vi Error detected while processing /etc/vimrc: line 62: E488: Trailing characters: # rhbz 1159920 Press ENTER or type command to continue $ diff -u /etc/virc{,.rpmnew} --- /etc/virc 2015-02-26 09:53:51.000000000 -0300 +++ /etc/virc.rpmnew 2015-03-01 22:34:46.000000000 -0300 @@ -59,7 +59,7 @@ set t_Sf=m endif -# rhbz 1159920 +" rhbz 1159920 if $COLORTERM=="gnome-terminal" set background=light else I can correct it manually, but likely will hit others.
Wonderful ... so now it breaks GVIM :/ can we revert this until you find out how to reliably detect that VIM is actually running in terminal and that there is dark or light theme used?
Moreover, it seems that $COLORTERM is not supported anymore by gnome terminal: [1] https://bugzilla.redhat.com/show_bug.cgi?id=1166428
Also, there is already term_bg_default() in [1] to detect terminal background. If you really want to do something about it, this is probably the right place to start to tinker. [1] https://code.google.com/p/vim/source/browse/src/option.c
Ouch. term_bg_default() looks terribly hackish now. Possibly a more straightforward fix for now would be something along these lines? if has("gui_running") set bg=light else set bg=dark endif
(In reply to Lubomir Rintel from comment #12) > Ouch. term_bg_default() looks terribly hackish now. Possibly a more > straightforward fix for now would be something along these lines? > > if has("gui_running") > set bg=light > else > set bg=dark > endif Would be definitely better for GVIM, but I am still using light theme for terminal, as it was previously default for ages. So this is not going to help. The best would be either to stick to VIM defaults or improve the detection algorithm. Otherwise there will be always somebody dissatisfied.
(In reply to Vít Ondruch from comment #13) > The best would be either to stick to VIM defaults or improve the > detection algorithm. +1 And, in the latter case, please make sure to submit it upstream. Deviating from upstream should normally have a very high bar to be accepted in Fedora. I suggest to revert the change for now, and let the interested people work with the upstream on a smarter background detection.
I opened a separate bug 1225652 for gvim, before I saw that Vit reopened this in comment #9. Should I dup it into this?
Just took a look at the vim sources. In GUI case it uses gui_bg_default() which is pretty reliable, so in has("gui_running") case you're just defeating that detection. Yes term_bg_default() is not perfect (in particular, because there's no API to query terminal colors) but it's still better than your unconditional bg=dark, and anyway it's something people have got used to. So please revert the change.
(In reply to Roman Kagan from comment #16) > Just took a look at the vim sources. > > In GUI case it uses gui_bg_default() which is pretty reliable, so in > has("gui_running") case you're just defeating that detection. That's a good point. > Yes term_bg_default() is not perfect (in particular, because there's no API > to query terminal colors) but it's still better It's precisely completely useless and nothing more. > than your unconditional > bg=dark, No, our default terminal is dark. Dark default for VIM makes sense. > and anyway it's something people have got used to. We haven't. Terminal got switched to dark only a release ago. > So please revert the change. That makes no sense -- it's going to break the out-of-box experience for terminal vim again. " rhbz 1159920 if !has("gui_running") if $COLORTERM=="gnome-terminal" set background=light else set background=dark endif endif Something like this seems like an obvious solution (unless someone wants to "do the right thing", design a specification about querying the terminal colors and make the terminal emulators use it).
IMHO making vim show unreadable colors by default for all but one terminal should be mentioned in the release notes, since it is an important tool for a lot of users.
(In reply to Lubomir Rintel from comment #17) > (In reply to Roman Kagan from comment #16) > > Yes term_bg_default() is not perfect (in particular, because there's no API > > to query terminal colors) but it's still better > > It's precisely completely useless and nothing more. It covers correctly linux console and rxvt derivatives who set $COLORFGBG. That's already more useful than what's done by this change. > > So please revert the change. > > That makes no sense -- it's going to break the out-of-box experience for > terminal vim again. Disagreed. You solve a problem for people running vim in the default configuration of gnome terminal, who didn't do this before and who don't know how to tweak it. Now you break - people using different terminal emulators (xterm, rxvt, konsole, xfce terminal, etc.); note that rxvt and konsole set $COLORFGBG so for them you defeat the smarter logic of term_bg_default() - people who've already done adjustments in their setups - people who ssh to / from different OSes and get different behavior Please realize that deviating from the upstream is a bad thing in general. When things don't work for someone, tweaks done in the system configuration by a packager who happened to have different taste from the upstream is the least expected place to look for problems. People start with searching on the internet or reading the manuals. Now every such document should contain a special case for the unfortunate sitting on Fedora 22, right? If you're really up to it submit a patch to vte to set $COLORFGBG corresponding to the color scheme used, and you'll do a big favor not only to vim but to all curses-based programs.
(In reply to Roman Kagan from comment #19) > If you're really up to it submit a patch to vte to set $COLORFGBG > corresponding to the color scheme used, and you'll do a big favor not only > to vim but to all curses-based programs. Not sure why you're assuming COLORFGBG is a good idea. Seems terrible to me; close to no terminal emulators support it and it's arguably badly designed -- can't react to color scheme changes. An escape code would probably be a better idea; too bad there's no standard one.
Created attachment 1033306 [details] [PATCH] term: add support for querying background color from XTerm (In reply to Lubomir Rintel from comment #20) > (In reply to Roman Kagan from comment #19) > > If you're really up to it submit a patch to vte to set $COLORFGBG > > corresponding to the color scheme used, and you'll do a big favor not only > > to vim but to all curses-based programs. > > Not sure why you're assuming COLORFGBG is a good idea. Seems terrible to me; > close to no terminal emulators support it and it's arguably badly designed > -- can't react to color scheme changes. An escape code would probably be a > better idea; too bad there's no standard one. Oh, I'm probably a bit retarded: there indeed is an escape sequence for that, implemented by xterm and gnome-terminal; which is good enough for me. I've created a patch for that. I can't seem to be able to submit it to the list though -- it just bounces back. If anyone knows how to submit a patch for Vim, please feel fee to send it...
For the record, tried Lubomír's patch + enabled termresponse debugging and it seems that vte may not handle the BG request well per both guake and lxterminal: 0.000000: NV setting crv_status to CRV_GET 0.243374: CL Sending U7 request 0.243441: CL Sending BG request 0.245391: NV Sending CRV 0.260506: NV Received U7 status 0.260513: NV Received CRV 0.260524: NV Enable checking for XT codes 0.260526: NV Requesting XT 0: Co 0.260527: NV Requesting XT 1: ku 0.260529: NV Requesting XT 2: kd 0.260530: NV Requesting XT 3: kr 0.260531: NV Requesting XT 4: kl 0.260532: NV Requesting XT 5: #2 0.260534: NV Requesting XT 6: #4 0.260535: NV Requesting XT 7: %i 0.260536: NV Requesting XT 8: *7 0.260537: NV Requesting XT 9: k1 0.678088: NV normal character 0.925835: NV normal character 0.965814: NV normal character 1.021590: NV normal character No idea what's wrong or if anything at all, just my observation. Let me know if I can help in any way. (Was affected by "the new behaviour", too).
For the time being, I put following to my .vimrc: > set background=light
xfce's terminal sets COLORTERM to xfce-terminal - I edited /etc/vimrc to check for that too. Otherwise perl looks like bright yellow on white, which is unusable...
Another freshly updated F22 user here, the new default truly looks terrible (black-on-white xfce-terminal here). Working around in ~/.vimrc is easy enough but it is somewhat annoying to have to work around some supposedly gnome-terminal specific change when I'm specifically NOT using that terminal.
(In reply to Lubomir Rintel from comment #17) > " rhbz 1159920 > if !has("gui_running") > if $COLORTERM=="gnome-terminal" > set background=light > else > set background=dark > endif > endif This is wrong patch, since $COLORTERM was deprecated and is not set anymore by gnoem-terminal. Please let term_bg_default() do its job and fix this function if needed.
Vit is probably right with comment#26. In the meantime, please think of the mate users and apply this: -if $COLORTERM=="gnome-terminal" +if $COLORTERM=="gnome-terminal" || $COLORTERM=="mate-terminal" or maybe even +if $COLORTERM =~ "-terminal$" Or, to also satisfy GVim users +if has("gui_running") || $COLORTERM =~ "-terminal$"
The offending snipped has now been removed for F23 as Rawhide Vim detects this itself.
(In reply to Lubomir Rintel from comment #28) > The offending snipped has now been removed for F23 as Rawhide Vim detects > this itself. Thanks for the upstream patch \ó/
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
(In reply to Lubomir Rintel from comment #21) > Created attachment 1033306 [details] > [PATCH] term: add support for querying background color from XTerm After some time that this worked for me on F25, I noticed after some time that vim-enhanced-8.0.562-1.fc25.x86_64 regressed back and that Lubomír patch doesn't work for some reason. IOW, that vim and terminal are not able to automatically agree on correct background color (in my case, I should have 'set bg=dark', but I have the wrong 'set bg=light'). Note that I have F25 server (not yet updated) where I have the old vim-enhanced-8.0.514-1.fc25.x86_64, and that (also remote) vim is able to chat with my local terminal (konsole in KDE5) and the background is set correctly. So the bug is vim (not in my terminal). Let me know if we need more info.
Reproduced in gnome-terminal. Note that in KDE's konsole you need to first unset COLORFGBG variable to be able to reproduce this bug.
This bug is currently reported against a Fedora version which is already unsuported. I am changing the version to '27', the latest supported release. Please check whether this bug is still an issue on the '27' release. If you find this bug not being applicable on this release, please close it.
It is working fine again, on f28.