diff src/terminal.c @ 12632:b1a7e3968a31 v8.0.1194

patch 8.0.1194: actual fg and bg colors of terminal are unknown commit https://github.com/vim/vim/commit/65e4c4f6868882a380c319632a1728a5e7d274ad Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 14 23:24:25 2017 +0200 patch 8.0.1194: actual fg and bg colors of terminal are unknown Problem: Actual fg and bg colors of terminal are unknown. Solution: Add t_RF. Store response to t_RB and t_RF, use for terminal.
author Christian Brabandt <cb@256bit.org>
date Sat, 14 Oct 2017 23:30:05 +0200
parents 97a2f34962ee
children 94566ecb55f0
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -40,12 +40,12 @@
  * TODO:
  * - in GUI vertical split causes problems.  Cursor is flickering. (Hirohito
  *   Higashi, 2017 Sep 19)
- * - Can we get the default fg/bg color of the terminal and use it for
- *   libvterm?  Should also fix ssh-in-a-win.
+ * - patch to handle composing characters. (Ozaki Kiichi, #2195)
  * - double click in Window toolbar starts Visual mode (but not always?).
  * - Shift-Tab does not work.
  * - after resizing windows overlap. (Boris Staletic, #2164)
  * - :wall gives an error message. (Marius Gedminas, #2190)
+ *   patch suggested by Yasuhiro Matsumoto, Oct 10
  * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
  *   is disabled.
  * - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
@@ -59,7 +59,7 @@
  * - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
  *   changes to "!shell".
  *   (justrajdeep, 2017 Aug 22)
- * - Redrawing is slow with Athena and Motif.
+ * - Redrawing is slow with Athena and Motif.  Also other GUI? (Ramel Eshed)
  * - For the GUI fill termios with default values, perhaps like pangoterm:
  *   http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134
  * - if the job in the terminal does not support the mouse, we can use the
@@ -2608,28 +2608,37 @@ create_vterm(term_T *term, int rows, int
 	if (cterm_bg >= 0)
 	    cterm_color2rgb(cterm_bg, bg);
     }
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
     else
     {
+#if defined(WIN3264) && !defined(FEAT_GUI_W32)
 	int tmp;
+#endif
 
 	/* In an MS-Windows console we know the normal colors. */
 	if (cterm_normal_fg_color > 0)
 	{
 	    cterm_color2rgb(cterm_normal_fg_color - 1, fg);
+# if defined(WIN3264) && !defined(FEAT_GUI_W32)
 	    tmp = fg->red;
 	    fg->red = fg->blue;
 	    fg->blue = tmp;
+# endif
 	}
+	else
+	    term_get_fg_color(&fg->red, &fg->green, &fg->blue);
+
 	if (cterm_normal_bg_color > 0)
 	{
 	    cterm_color2rgb(cterm_normal_bg_color - 1, bg);
+# if defined(WIN3264) && !defined(FEAT_GUI_W32)
 	    tmp = bg->red;
 	    bg->red = bg->blue;
 	    bg->blue = tmp;
+# endif
 	}
+	else
+	    term_get_bg_color(&bg->red, &bg->green, &bg->blue);
     }
-#endif
 
     vterm_state_set_default_colors(vterm_obtain_state(vterm), fg, bg);