From 337f3eaa6f2f2124f1551b0f52547f57313ccc09 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 16 Jan 2020 14:16:09 -0500 Subject: Fixed some Windows terminal version issues and updated to PDCurses 3.9. `io.popen()` and `os.execute()` change the console mode such that mouse clicks are no longer detected. Make sure it's reset. Also prevent `os.execute()` output from overwriting the window. --- core/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/init.lua b/core/init.lua index 9b47de12..5724c908 100644 --- a/core/init.lua +++ b/core/init.lua @@ -21,11 +21,11 @@ if CURSES and WIN32 then function os.spawn(argv, ...) local current_dir = lfs.currentdir() local i = 1 - if type(select(i, ...)) == 'string' then + if type(select(i, ...) or nil) == 'string' then lfs.chdir(select(i, ...)) -- cwd i = i + 1 end - if type(select(i, ...)) == 'table' then i = i + 1 end -- env (ignore) + if type(select(i, ...) or nil) == 'table' then i = i + 1 end -- env (ignore) local p = io.popen(argv..' 2>&1') if select(i, ...) then select(i, ...)(p:read('a')) end -- stdout_cb local status = select(3, p:close()) -- cgit v1.2.3