From owner-svn-src-head@freebsd.org Tue Feb 27 21:52:23 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 82B68F2CA18; Tue, 27 Feb 2018 21:52:23 +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 2E614724FA; Tue, 27 Feb 2018 21:52:23 +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 2967010865; Tue, 27 Feb 2018 21:52:23 +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 w1RLqNdj037182; Tue, 27 Feb 2018 21:52:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RLqMmW037179; Tue, 27 Feb 2018 21:52:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802272152.w1RLqMmW037179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 21:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330084 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330084 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: Tue, 27 Feb 2018 21:52:23 -0000 Author: kevans Date: Tue Feb 27 21:52:22 2018 New Revision: 330084 URL: https://svnweb.freebsd.org/changeset/base/330084 Log: lualoader: Replace instances of \027 with KEYSTR_ESCAPE With exception to drawing bits, which should probably be kept as-is to not make a mess out of things. Reported by: rpokala (a while ago) Modified: head/stand/lua/color.lua head/stand/lua/screen.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Tue Feb 27 21:30:24 2018 (r330083) +++ head/stand/lua/color.lua Tue Feb 27 21:52:22 2018 (r330084) @@ -62,14 +62,14 @@ function color.escapef(color_value) if color.disabled then return color_value end - return "\027[3" .. color_value .. "m" + return core.KEYSTR_ESCAPE .. "[3" .. color_value .. "m" end function color.escapeb(color_value) if color.disabled then return color_value end - return "\027[4" .. color_value .. "m" + return core.KEYSTR_ESCAPE .. "[4" .. color_value .. "m" end function color.escape(fg_color, bg_color, attribute) @@ -81,7 +81,7 @@ function color.escape(fg_color, bg_color, attribute) else attribute = attribute .. ";" end - return "\027[" .. attribute .. + return core.KEYSTR_ESCAPE .. "[" .. attribute .. "3" .. fg_color .. ";4" .. bg_color .. "m" end @@ -89,14 +89,14 @@ function color.default() if color.disabled then return "" end - return "\027[0;37;40m" + return core.KEYSTR_ESCAPE .. "[0;37;40m" end function color.highlight(str) if color.disabled then return str end - return "\027[1m" .. str .. "\027[0m" + return core.KEYSTR_ESCAPE .. "[1m" .. str .. core.KEYSTR_ESCAPE .. "[0m" end return color Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Tue Feb 27 21:30:24 2018 (r330083) +++ head/stand/lua/screen.lua Tue Feb 27 21:52:22 2018 (r330084) @@ -38,7 +38,7 @@ function screen.clear() if core.isSerialBoot() then return end - loader.printc("\027[H\027[J") + loader.printc(core.KEYSTR_ESCAPE .. "[H" .. core.KEYSTR_ESCAPE .. "[J") end function screen.setcursor(x, y) @@ -46,7 +46,7 @@ function screen.setcursor(x, y) return end - loader.printc("\027[" .. y .. ";" .. x .. "H") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. y .. ";" .. x .. "H") end function screen.movecursor(dx, dy) @@ -55,15 +55,15 @@ function screen.movecursor(dx, dy) end if dx < 0 then - loader.printc("\027[" .. -dx .. "D") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dx .. "D") elseif dx > 0 then - loader.printc("\027[" .. dx .. "C") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. dx .. "C") end if dy < 0 then - loader.printc("\027[" .. -dy .. "A") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dy .. "A") elseif dy > 0 then - loader.printc("\027[" .. dy .. "B") + loader.printc(core.KEYSTR_ESCAPE .. "[" .. dy .. "B") end end @@ -89,7 +89,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc("\027[25;0H") + loader.printc(core.KEYSTR_ESCAPE .. "[25;0H") end return screen