From e30b40fc2cd80cd3b66622db8f505dfc9c1db8e9 Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 24 Oct 2022 09:37:57 +0200 Subject: Fix piped streams --- src/display/client.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/display/client.nim') 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? -- cgit 1.4.1-2-gfad0