From owner-svn-src-all@freebsd.org Wed Feb 28 04:31:20 2018 Return-Path: Delivered-To: svn-src-all@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 8CCFDF26C2C; Wed, 28 Feb 2018 04:31:20 +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 40BA08347C; Wed, 28 Feb 2018 04:31:20 +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 3B8C714AD5; Wed, 28 Feb 2018 04:31:20 +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 w1S4VKIn044982; Wed, 28 Feb 2018 04:31:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S4VKTu044980; Wed, 28 Feb 2018 04:31:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802280431.w1S4VKTu044980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 04:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330099 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 04:31:20 -0000 Author: kevans Date: Wed Feb 28 04:31:19 2018 New Revision: 330099 URL: https://svnweb.freebsd.org/changeset/base/330099 Log: lualoader: Further screen cleanup - Add screen.default_x and screen.default_y to determine where screen.defcursor resets the cursor to. - Use screen.setcursor in screen.defcursor instead of rewriting the escape sequence. - Use screen.default_y when resetting the cursor after writing the new twiddle character, add a comment verbally describing the position just in case. Modified: head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Wed Feb 28 04:23:28 2018 (r330098) +++ head/stand/lua/password.lua Wed Feb 28 04:31:19 2018 (r330099) @@ -47,7 +47,8 @@ function password.read(prompt_length) local function draw_twiddle() loader.printc(" " .. twiddle_chars[twiddle_pos]) - screen.setcursor(prompt_length + 2, 25) + -- Reset cursor to just after the password prompt + screen.setcursor(prompt_length + 2, screen.default_y) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end Modified: head/stand/lua/screen.lua ============================================================================== --- head/stand/lua/screen.lua Wed Feb 28 04:23:28 2018 (r330098) +++ head/stand/lua/screen.lua Wed Feb 28 04:31:19 2018 (r330099) @@ -34,6 +34,9 @@ local core = require("core") local screen = {} -- Module exports +screen.default_x = 0 +screen.default_y = 25 + function screen.clear() if core.isSerialBoot() then return @@ -71,7 +74,7 @@ function screen.defcursor() if core.isSerialBoot() then return end - loader.printc(core.KEYSTR_CSI .. "25;0H") + screen.setcursor(screen.default_x, screen.default_y) end return screen