From 211fbe3a7f367e8df1a9d21c70fb867220c5f90d Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 17 Apr 2023 01:46:29 +0100 Subject: quit nicely on eof (ctrl-d) --- repl.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repl.lua b/repl.lua index 8abb822..4076729 100644 --- a/repl.lua +++ b/repl.lua @@ -32,6 +32,9 @@ local function read_chunk() -- if error ends in try multiline local function try(text) + if text == nil then + os.exit() + end if text:sub(1,3) == ",r " then return function() reload(text:sub(4)) print("reloaded "..text:sub(4)) end end -- cgit v1.2.3