From owner-svn-src-head@freebsd.org Mon Apr 3 13:06:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B512D2C98C; Mon, 3 Apr 2017 13:06:29 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD3AC36; Mon, 3 Apr 2017 13:06:29 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v33D6Sr6089625; Mon, 3 Apr 2017 13:06:28 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v33D6Srw089619; Mon, 3 Apr 2017 13:06:28 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704031306.v33D6Srw089619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 3 Apr 2017 13:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316459 - head/usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 13:06:29 -0000 Author: bde Date: Mon Apr 3 13:06:28 2017 New Revision: 316459 URL: https://svnweb.freebsd.org/changeset/base/316459 Log: Show high (blinking foreground/bright background) background colors. Format output and source better for this. Format output for 40 columns if there are less than 80 columns. Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 3 13:04:36 2017 (r316458) +++ head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 3 13:06:28 2017 (r316459) @@ -1167,6 +1167,7 @@ static void test_frame(void) { vid_info_t info; + char *bg, *sep; int i, fore; info.size = sizeof(info); @@ -1174,15 +1175,25 @@ test_frame(void) err(1, "getting console information"); fore = 15; + if (info.mv_csz < 80) { + bg = "BG"; + sep = " "; + } else { + bg = "BACKGROUND"; + sep = " "; + } fprintf(stdout, "\033[=0G\n\n"); for (i=0; i<8; i++) { - fprintf(stdout, "\033[=%dF\033[=0G %2d \033[=%dF%-16s" - "\033[=%dF\033[=0G %2d \033[=%dF%-16s " - "\033[=%dF %2d \033[=%dGBACKGROUND\033[=0G\n", - fore, i, i, legal_colors[i], - fore, i+8, i+8, legal_colors[i+8], - fore, i, i); + fprintf(stdout, + "\033[=%dF\033[=0G%2d \033[=%dF%-7s%s" + "\033[=%dF\033[=0G%2d \033[=%dF%-12s%s" + "\033[=%dF%2d \033[=%dG%s\033[=0G%s" + "\033[=%dF%2d \033[=%dG%s\033[=0G\n", + fore, i, i, legal_colors[i], sep, + fore, i + 8, i + 8, legal_colors[i + 8], sep, + fore, i, i, bg, sep, + fore, i + 8, i + 8, bg); } fprintf(stdout, "\033[=%dF\033[=%dG\033[=%dH\033[=%dI\n", info.mv_norm.fore, info.mv_norm.back,