mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
134 stars 73 forks source link

VTE 0.56 breaks bold colors #278

Closed micheal65536 closed 5 years ago

micheal65536 commented 5 years ago

In VTE 0.56 the widget option to use bright colors for bold text was changed from enabled by default to disabled by default, and renamed from no_bold_is_bright to bold_is_bright (i.e. it must now be explicitly enabled). MATE terminal does not use this option therefore a lot of applications that use bold/bright text are now broken (including ls and cmake).

lukefromdc commented 5 years ago

In running ls /home or cmake --help I don't see any bold text in gnome-terminal as well as in mate-terminal. Where should I expect to see it? Running Debian Unstable.

micheal65536 commented 5 years ago

@lukefromdc OK those are just examples but really the issue relates to colored bold output (compared to colored non-bold output). Previously bold output would be a brighter color (which made it easier to distinguish and more visually pleasing) whereas now bold and non-bold both use the darker colors.

In my case, ls uses colors to show directories, executable files, symbolic links, and so on. You might need to use ls --color=auto to achieve the same effect, if you don't have this enabled by default.

cmake uses colored output to show progress/status when compiling, cmake --help does not produce colored output but compiling anything with cmake should do so.

There are many other examples as well. gcc uses colored output to show error and warning messages, grep --color=auto will use bold red to show the specific part of a line that matched the search pattern, and so on.

mdinslage commented 5 years ago

@micheal65536 I believe I am having the same problem, here is a link to the problem I am having, is it the same you are experiencing?

https://github.com/mateslackbuilds/msb/issues/29

mdinslage commented 5 years ago

I reverted the commit and compiled VTE myself and confirmed that VTE is the issue. Hopefully the mate team can fix this.

sc0w commented 5 years ago

@mdinslage which commit?

If it is vte issue, you can report it here: https://gitlab.gnome.org/GNOME/vte/issues

mdinslage commented 5 years ago

@sc0w This commit https://github.com/GNOME/vte/commit/ab5161c7df07e09bc7796812d6fa6fdf79f61830

I don't think reporting it is going to do any good. It's not a bug, but a deliberate choice they made. They will probably tell is to have the mate people fix the terminal.

raveit65 commented 5 years ago

It sounds that they make it optional. https://bugzilla.gnome.org/show_bug.cgi?id=762247#c25

micheal65536 commented 5 years ago

@mdinslage Yes, that does appear to be the same issue.

@sc0w The GNOME developers being the way they are, I seriously doubt that reporting an issue of "changing the default from enabled-by-default to disabled-by-default with no warning or co-ordination with other developers breaks anything else using your library" is going to achieve anything, especially when they appear to be dead-set on removing bright-bold support entirely in the future (see https://bugzilla.gnome.org/show_bug.cgi?id=762247#c30 and later comments, where they intend to push every legacy application to update instead of retaining compatibility). For that matter, when it is removed entirely, the MATE developers will probably need to fork VTE themselves if they wish to retain compatibility.

As for now, the correct option would be to change MATE terminal to explicitly set the new bold_is_bright option. This might be simple enough to do myself so I might submit a pull request later if I get a chance to look at this.

AngryPhantom commented 5 years ago

Hello, gyus! Could you please help me find out what exactly should I change/patch in VTE in order to make bold text and colors work in mate-terminal? I'm running Debian 9 Stretch (libvte-2.91-0). I know what to patch in mate-terminal but it's a no go for me since I updated MATE from backports to a newer version and when I try to recompile it 'build-dep' gives me a dependency hell. So recompiling VTE is easier in my case. Thank you!

micheal65536 commented 5 years ago

@AngryPhantom I don't fully understand your issue. https://packages.debian.org/stretch/libvte-2.91-0 seems to indicate that libvte-2.91-0 corresponds to VTE version 0.46.1 (VTE version numbers are messed up thanks to the GNOME developers). This change only occurred in VTE 0.56, and the version that you are using should be unaffected (i.e. you probably aren't experiencing this issue in the first place). Nevertheless I have included the patch that I have been using against VTE 0.56.

--- a/src/app/app.cc
+++ b/src/app/app.cc
@@ -42,13 +42,13 @@ public:
         gboolean allow_window_ops{false};
         gboolean audible_bell{false};
         gboolean backdrop{false};
-        gboolean bold_is_bright{false};
+        gboolean bold_is_bright{true};
         gboolean console{false};
         gboolean debug{false};
         gboolean icon_title{false};
         gboolean keep{false};
         gboolean no_argb_visual{false};
         gboolean no_bold{false};
         gboolean no_builtin_dingus{false};
         gboolean no_context_menu{false};
         gboolean no_double_buffer{false};
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7996,7 +7996,7 @@ Terminal::Terminal(vte::platform::Widget* w,
    m_audible_bell = TRUE;
         m_text_blink_mode = VTE_TEXT_BLINK_ALWAYS;
    m_allow_bold = TRUE;
-        m_bold_is_bright = FALSE;
+        m_bold_is_bright = TRUE;
         m_rewrap_on_resize = TRUE;

         m_input_enabled = TRUE;
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -1364,7 +1364,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
          */
         pspecs[PROP_BOLD_IS_BRIGHT] =
                 g_param_spec_boolean ("bold-is-bright", NULL, NULL,
-                                      FALSE,
+                                      TRUE,
                                       (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));

         /**
AngryPhantom commented 5 years ago

Yes, you are right, libvte is 2.91-0 (0.46) in Debian Stretch. After fresh install I upgraded MATE from backports (1.16 -> 1.20). Unfortunately, I don't remember whether it was OK before upgrading, but after it I see the following (directories are not bold): http://0x0.st/zNG5.png. There is an option in the MATE Terminal settings to allow bold text (http://0x0.st/zNGR.png) which stopped working. It was OK in Debian 8. I'm not a Github guru yet so I'm sorry if I'm posting in the wrong thread :) Anyway, thanks for the patch! I'll try to test it tomorrow.

AngryPhantom commented 5 years ago

I even posted an issue some time ago here: https://github.com/mate-desktop/mate-terminal/issues/234 There was also a strange thing with colors in MATE Terminal with Midnight Commander: in 64-bit Debian the selected files were red, not yellow as they used to be. But in 32-bit Debian everything was OK. I was really distracted and didn't know what package to blame (and still can't figure out), so please don't take this issue too seriously...

micheal65536 commented 5 years ago

@AngryPhantom I believe you are experiencing a different issue. VTE 0.46 is supposed to be unaffected by this issue (the issue first showed up when Arch updated to VTE 0.56).

I'm not sure I fully understand what you're experiencing as I don't use Midnight Commander, so perhaps you could provide a screenshot of both versions. Alternatively if I get a chance I might try to reproduce the issue myself. I'm also not sure why 64-bit would be affected but not 32-bit.

I would suggest doing a git bisect between versions 1.16 and 1.20 to find where the issue first showed up. I can provide more instructions for doing this if needed.

AngryPhantom commented 5 years ago

Not to duplicate here there is an issue in another thread: https://github.com/mate-desktop/mate-terminal/issues/234#issuecomment-485394530 Thank you!