From ec5d938a6424fc7cb6f3fa222dc4c3cc250dc5f9 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 13 Apr 2020 04:09:44 +1000 Subject: [PATCH] added a quit function to the shell environment, for obvious purposes --- lib/shell.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/shell.lua b/lib/shell.lua index b5912d5..538cce8 100644 --- a/lib/shell.lua +++ b/lib/shell.lua @@ -21,6 +21,9 @@ end function shell.interactive() local shenv = setmetatable({}, {__index=shindex}) local run = true + function shenv.quit() + run = false + end while run do io.write(string.format("\27[32m%s:%s>\27[0m ",os.getenv("HOSTNAME") or "localhost",(os.getenv("PWD") or _VERSION))) local input = io.read()