From 6f6595b39a8e9bdae71e1ea4521e6778b5eb331c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 3 Dec 2021 16:12:51 -0800 Subject: show state of screen on runtime error This is essential when debugging. --- src/lua.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lua.c b/src/lua.c index c5b5cb9..00a9349 100644 --- a/src/lua.c +++ b/src/lua.c @@ -98,6 +98,13 @@ static int report_in_developer_mode (lua_State *L, int status) { const char *msg = strdup(lua_tostring(L, -1)); /* memory leak */ if (msg == NULL) msg = "(error object is not a string)"; lua_pop(L, 1); + for (int x = 0; x < COLS; ++x) { + mvaddch(LINES-2, x, ' '); + mvaddch(LINES-1, x, ' '); + } + mvaddstr(LINES-2, 0, msg); + mvaddstr(LINES-1, 0, "press any key to continue"); + getch(); developer_mode(L, msg); } return status; -- cgit 1.4.1-2-gfad0