about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-14 08:46:24 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-14 09:48:41 -0800
commit2cc6912e85d4708c2dcc91f854a02871c1b3818c (patch)
tree5d22c9c632d28d8075028616b5c955b9b6a7811d
parent4ab3ccebb58fa3d6b8c39cf671d50ce9680beae0 (diff)
downloadteliva-2cc6912e85d4708c2dcc91f854a02871c1b3818c.tar.gz
find _some_ way to show error on initial load
-rw-r--r--src/lua.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lua.c b/src/lua.c
index ecdf732..bf62bc6 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -61,9 +61,15 @@ static void print_usage (void) {
 
 
 static void l_message (const char *pname, const char *msg) {
-  if (pname) printw("%s: ", pname);
-  printw("%s\n", msg);
+  if (!stdscr || isendwin()) {
+    printf("%s: %s\n", pname, msg);
+    exit(1);
+  }
+  if (pname) mvprintw(LINES-2, 0, "%s: ", pname);
+  printw(msg);
+  mvprintw(LINES-1, 0, "sorry, you'll need to edit the image directly. press any key to exit.");
   refresh();
+  getch();
 }