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-24 09:37:57 +0200
committerbptato <nincsnevem662@gmail.com>2022-10-24 09:37:57 +0200
commite30b40fc2cd80cd3b66622db8f505dfc9c1db8e9 (patch)
tree41e3bf684d9f22d88595f34c44c92ec04a8ff88b /src/display/client.nim
parent639e56e3377629380d0777a533d1ebd7afd5645a (diff)
downloadchawan-e30b40fc2cd80cd3b66622db8f505dfc9c1db8e9.tar.gz
Fix piped streams
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 54883a53..c51a4e5b 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -69,7 +69,9 @@ proc readPipe(client: Client, ctype: string) =
   let buffer = newBuffer(client.config, client.loader)
   buffer.contenttype = if ctype != "": ctype else: "text/plain"
   buffer.ispipe = true
-  buffer.istream = newFileStream(stdin)
+  let ifs = newFileStream(stdin)
+  buffer.istream = newStringStream(ifs.readAll())
+  ifs.close()
   buffer.location = newURL("file://-")
   client.pager.addBuffer(buffer)
   #TODO is this portable at all?