From nobody@FreeBSD.org  Wed Apr  2 10:41:16 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 1C9A1B37
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Apr 2014 10:41:16 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 09E2AA71
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Apr 2014 10:41:16 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s32AfFpF009685
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 2 Apr 2014 10:41:15 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s32AfFX2009659;
	Wed, 2 Apr 2014 10:41:15 GMT
	(envelope-from nobody)
Message-Id: <201404021041.s32AfFX2009659@cgiserv.freebsd.org>
Date: Wed, 2 Apr 2014 10:41:15 GMT
From: Claude Buisson <clbuisson@orange.fr>
To: freebsd-gnats-submit@FreeBSD.org
Subject: vt(4) text cursor invisible in reverse video
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         188196
>Category:       kern
>Synopsis:       [vt] [patch] vt(4) text cursor invisible in reverse video
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ray
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 02 10:50:00 UTC 2014
>Closed-Date:    Tue Apr 08 20:41:00 UTC 2014
>Last-Modified:  Tue Apr 08 20:57:57 UTC 2014
>Originator:     Claude Buisson
>Release:        11.0-CURRENT
>Organization:
none
>Environment:
FreeBSD 11.0-CURRENT #0 r260577M: Sat Jan 18 17:31:37 CET 2014
      toor@fidel:/home/obj/home/src/sys/ADELE11X i386
>Description:
In console/text mode, the vt(4) cursor disappears when the application
switches to reverse video, e.g. when exiting and saving a file edited with nano.
>How-To-Repeat:
see Description
>Fix:
I use the following patch

Patch attached with submission follows:

--- sys/dev/vt/vt_core.c.orig	2013-12-26 15:25:37.000000000 +0100
+++ sys/dev/vt/vt_core.c	2014-03-22 13:44:54.000000000 +0100
@@ -667,8 +667,11 @@
 	}
 
 	if (cursor) {
+		term_color_t tmp;
+
+		tmp = *fg;
 		*fg = *bg;
-		*bg = TC_WHITE;
+		*bg = tmp;
 	}
 }
 


>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/188196: commit references a PR
Date: Tue,  8 Apr 2014 14:14:31 +0000 (UTC)

 Author: ray
 Date: Tue Apr  8 14:14:25 2014
 New Revision: 264258
 URL: http://svnweb.freebsd.org/changeset/base/264258
 
 Log:
   Fix cursor color in reverse video mode.
   
   PR:		kern/188196
   Submitted by:	Claude Buisson <clbuisson@orange.fr> (original version)
   MFC after:	1 week
   Sponsored by:	The FreeBSD Foundation
 
 Modified:
   head/sys/dev/vt/vt_core.c
 
 Modified: head/sys/dev/vt/vt_core.c
 ==============================================================================
 --- head/sys/dev/vt/vt_core.c	Tue Apr  8 07:32:32 2014	(r264257)
 +++ head/sys/dev/vt/vt_core.c	Tue Apr  8 14:14:25 2014	(r264258)
 @@ -652,24 +652,26 @@ static inline void
  vt_determine_colors(term_char_t c, int cursor,
      term_color_t *fg, term_color_t *bg)
  {
 +	term_color_t tmp;
 +	int invert;
 +
 +	invert = 0;
  
  	*fg = TCHAR_FGCOLOR(c);
  	if (TCHAR_FORMAT(c) & TF_BOLD)
  		*fg = TCOLOR_LIGHT(*fg);
  	*bg = TCHAR_BGCOLOR(c);
  
 -	if (TCHAR_FORMAT(c) & TF_REVERSE) {
 -		term_color_t tmp;
 +	if (TCHAR_FORMAT(c) & TF_REVERSE)
 +		invert ^= 1;
 +	if (cursor)
 +		invert ^= 1;
  
 +	if (invert) {
  		tmp = *fg;
  		*fg = *bg;
  		*bg = tmp;
  	}
 -
 -	if (cursor) {
 -		*fg = *bg;
 -		*bg = TC_WHITE;
 -	}
  }
  
  static void
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: ray 
State-Changed-When: Tue Apr 8 20:39:08 UTC 2014 
State-Changed-Why:  

Problem fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188196 
Responsible-Changed-From-To: freebsd-bugs->ray 
Responsible-Changed-By: ray 
Responsible-Changed-When: Tue Apr 8 20:56:30 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188196 
>Unformatted:
