about summary refs log tree commit diff stats
path: root/src/local/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-16 00:11:00 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-16 00:12:18 +0100
commit38c30549d3eda30a637af389694a0ecbc89973d5 (patch)
tree278ac0cdf80830d1aec981b8965e6998e3406ca9 /src/local/client.nim
parent63337efd3ad3b87bd0a5b42c3617918cb65205b1 (diff)
downloadchawan-38c30549d3eda30a637af389694a0ecbc89973d5.tar.gz
config: add start.console-buffer option
useful for debugging
Diffstat (limited to 'src/local/client.nim')
-rw-r--r--src/local/client.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 2c5963aa..87defeb4 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -153,7 +153,8 @@ proc command0(client: Client, src: string, filename = "<command>",
 proc command(client: Client, src: string) =
   client.command0(src)
   let container = client.consoleWrapper.container
-  container.tailOnLoad = true
+  if container != nil:
+    container.tailOnLoad = true
 
 proc suspend(client: Client) {.jsfunc.} =
   client.pager.term.quit()
@@ -715,7 +716,7 @@ const ConsoleTitle = "Browser Console"
 
 proc addConsole(pager: Pager; interactive: bool; clearFun, showFun, hideFun:
     proc()): ConsoleWrapper =
-  if interactive:
+  if interactive and pager.config.start.console_buffer:
     var pipefd: array[0..1, cint]
     if pipe(pipefd) == -1:
       raise newException(Defect, "Failed to open console pipe.")