From owner-svn-src-head@freebsd.org Mon Feb 26 04:12:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528FFF27821; Mon, 26 Feb 2018 04:12:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046F180F87; Mon, 26 Feb 2018 04:12:55 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B7B167D5; Mon, 26 Feb 2018 04:12:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q4CshO052646; Mon, 26 Feb 2018 04:12:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q4Csam052645; Mon, 26 Feb 2018 04:12:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802260412.w1Q4Csam052645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Feb 2018 04:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330010 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330010 X-SVN-Commit-Repository: base 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.25 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, 26 Feb 2018 04:12:55 -0000 Author: kevans Date: Mon Feb 26 04:12:54 2018 New Revision: 330010 URL: https://svnweb.freebsd.org/changeset/base/330010 Log: lualoader: screen argument fixes screen was also guilty of not-so-great argument names, but it was also guilty of handling color sequences on its own. Change those bits to using the color module instead. As a side note, between color and screen, I'm not 100% sure that returning the color_value is the right thing to do if we won't generate the escape sequences. This should be re-evaluated at a later time, and they should likely return nil instead. Modified: head/stand/lua/screen.lua Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Mon Feb 26 04:08:54 2018 (r330009) +++ head/stand/lua/screen.lua Mon Feb 26 04:12:54 2018 (r330010) @@ -49,18 +49,18 @@ function screen.setcursor(x, y) loader.printc("\027[" .. y .. ";" .. x .. "H") end -function screen.setforeground(c) +function screen.setforeground(color_value) if color.disabled then - return c + return color_value end - loader.printc("\027[3" .. c .. "m") + loader.printc(color.escapef(color_value)) end -function screen.setbackground(c) +function screen.setbackground(color_value) if color.disabled then - return c + return color_value end - loader.printc("\027[4" .. c .. "m") + loader.printc(color.escapeb(color_value)) end function screen.defcolor()