Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Feb 2018 22:02:40 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330087 - head/stand/lua
Message-ID:  <201802272202.w1RM2ekm043363@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Feb 27 22:02:39 2018
New Revision: 330087
URL: https://svnweb.freebsd.org/changeset/base/330087

Log:
  lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI

Modified:
  head/stand/lua/color.lua
  head/stand/lua/core.lua
  head/stand/lua/screen.lua

Modified: head/stand/lua/color.lua
==============================================================================
--- head/stand/lua/color.lua	Tue Feb 27 22:01:40 2018	(r330086)
+++ head/stand/lua/color.lua	Tue Feb 27 22:02:39 2018	(r330087)
@@ -62,14 +62,14 @@ function color.escapef(color_value)
 	if color.disabled then
 		return color_value
 	end
-	return core.KEYSTR_ESCAPE .. "[3" .. color_value .. "m"
+	return core.KEYSTR_CSI .. "3" .. color_value .. "m"
 end
 
 function color.escapeb(color_value)
 	if color.disabled then
 		return color_value
 	end
-	return core.KEYSTR_ESCAPE .. "[4" .. color_value .. "m"
+	return core.KEYSTR_CSI .. "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 core.KEYSTR_ESCAPE .. "[" .. attribute ..
+	return core.KEYSTR_CSI .. attribute ..
 	    "3" .. fg_color .. ";4" .. bg_color .. "m"
 end
 
@@ -89,14 +89,14 @@ function color.default()
 	if color.disabled then
 		return ""
 	end
-	return core.KEYSTR_ESCAPE .. "[0;37;40m"
+	return core.KEYSTR_CSI .. "0;37;40m"
 end
 
 function color.highlight(str)
 	if color.disabled then
 		return str
 	end
-	return core.KEYSTR_ESCAPE .. "[1m" .. str .. core.KEYSTR_ESCAPE .. "[0m"
+	return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "0m"
 end
 
 return color

Modified: head/stand/lua/core.lua
==============================================================================
--- head/stand/lua/core.lua	Tue Feb 27 22:01:40 2018	(r330086)
+++ head/stand/lua/core.lua	Tue Feb 27 22:02:39 2018	(r330087)
@@ -47,6 +47,7 @@ core.KEY_ENTER		= 13
 core.KEY_DELETE		= 127
 
 core.KEYSTR_ESCAPE	= "\027"
+core.KEYSTR_CSI		= core.KEYSTR_ESCAPE .. "["
 
 core.MENU_RETURN	= "return"
 core.MENU_ENTRY		= "entry"

Modified: head/stand/lua/screen.lua
==============================================================================
--- head/stand/lua/screen.lua	Tue Feb 27 22:01:40 2018	(r330086)
+++ head/stand/lua/screen.lua	Tue Feb 27 22:02:39 2018	(r330087)
@@ -38,7 +38,7 @@ function screen.clear()
 	if core.isSerialBoot() then
 		return
 	end
-	loader.printc(core.KEYSTR_ESCAPE .. "[H" .. core.KEYSTR_ESCAPE .. "[J")
+	loader.printc(core.KEYSTR_CSI .. "H" .. core.KEYSTR_CSI .. "J")
 end
 
 function screen.setcursor(x, y)
@@ -46,7 +46,7 @@ function screen.setcursor(x, y)
 		return
 	end
 
-	loader.printc(core.KEYSTR_ESCAPE .. "[" .. y .. ";" .. x .. "H")
+	loader.printc(core.KEYSTR_CSI .. 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(core.KEYSTR_ESCAPE .. "[" .. -dx .. "D")
+		loader.printc(core.KEYSTR_CSI .. -dx .. "D")
 	elseif dx > 0 then
-		loader.printc(core.KEYSTR_ESCAPE .. "[" .. dx .. "C")
+		loader.printc(core.KEYSTR_CSI .. dx .. "C")
 	end
 
 	if dy < 0 then
-		loader.printc(core.KEYSTR_ESCAPE .. "[" .. -dy .. "A")
+		loader.printc(core.KEYSTR_CSI .. -dy .. "A")
 	elseif dy > 0 then
-		loader.printc(core.KEYSTR_ESCAPE .. "[" .. dy .. "B")
+		loader.printc(core.KEYSTR_CSI .. dy .. "B")
 	end
 end
 
@@ -89,7 +89,7 @@ function screen.defcursor()
 	if core.isSerialBoot() then
 		return
 	end
-	loader.printc(core.KEYSTR_ESCAPE .. "[25;0H")
+	loader.printc(core.KEYSTR_CSI .. "25;0H")
 end
 
 return screen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802272202.w1RM2ekm043363>