From 315aa57a0c531adbc2187cd4123eb02ff75ba1dc Mon Sep 17 00:00:00 2001 From: mpmxyz Date: Sun, 17 May 2015 18:03:38 +0200 Subject: [PATCH] Removed duplicate Ctrl+C-Handling from term.read The event library already takes care about that. (returning an "interrupted" event) I noticed that because I couldn't exit command lines reliably. (The Ctrl+C-Handling in the event library replaces some events.) --- .../assets/opencomputers/loot/OpenOS/lib/term.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/term.lua b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/term.lua index a5a61afe5..1131c3f7c 100644 --- a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/term.lua +++ b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/term.lua @@ -357,9 +357,6 @@ function term.read(history, dobreak, hint, pwchar, filter) history[#history] = "" return true, nil end - elseif keyboard.isControlDown() and code == keyboard.keys.c then - history[#history] = "" - return true, nil elseif not keyboard.isControl(char) then insert(unicode.char(char)) end @@ -402,6 +399,10 @@ function term.read(history, dobreak, hint, pwchar, filter) cleanup() error("interrupted", 0) end + if name == "interrupted" then + cleanup() + return nil + end local ncx, ncy = getCursor() if ocx ~= ncx or ocy ~= ncy then cleanup()