about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-10-19 13:19:02 +0200
committerbptato <nincsnevem662@gmail.com>2022-10-19 13:19:02 +0200
commit99d1e817c5db384cd586221f552ede2c256d613b (patch)
tree1dd35b9aa849abd808567dde90a0282e22e27c4f /src/display/client.nim
parente0c1d414a196a0b064ff74e8290092e5dbd496be (diff)
downloadchawan-99d1e817c5db384cd586221f552ede2c256d613b.tar.gz
Fix crash on opening unavailable resources
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 1f15e907..78f29f43 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -290,9 +290,13 @@ proc launchClient*(client: Client, pages: seq[string], ctype: string, dump: bool
     client.pager.loadURL(page, force = true, ctype = ctype)
 
   if stdout.isatty and not dump:
-    when defined(posix):
-      enableRawMode()
-    client.inputLoop()
+    if client.pager.container != nil:
+      when defined(posix):
+        enableRawMode()
+      client.inputLoop()
+    else:
+      for msg in client.pager.status:
+        eprint msg
   else:
     for msg in client.pager.status:
       eprint msg