Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 20:18:23 +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: r329274 - head/stand/lua
Message-ID:  <201802142018.w1EKIN7C001142@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Wed Feb 14 20:18:23 2018
New Revision: 329274
URL: https://svnweb.freebsd.org/changeset/base/329274

Log:
  stand/lua: Exit sub-menus on backspace

Modified:
  head/stand/lua/menu.lua

Modified: head/stand/lua/menu.lua
==============================================================================
--- head/stand/lua/menu.lua	Wed Feb 14 20:15:32 2018	(r329273)
+++ head/stand/lua/menu.lua	Wed Feb 14 20:18:23 2018	(r329274)
@@ -270,8 +270,14 @@ function menu.run(m)
 
 	cont = true;
 	while cont do
-		local key = string.char(io.getchar());
+		local key = io.getchar();
 
+		-- Exit on backspace
+		if (key == 127) and (m ~= menu.welcome) then
+			break
+		end
+
+		key = string.char(key)
 		-- check to see if key is an alias
 		local sel_entry = nil;
 		for k, v in pairs(alias_table) do



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