aboutsummaryrefslogtreecommitdiffstats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-30 21:25:20 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-30 21:25:20 +0200
commitf9433f13765ca6ec6aa5d2c34dd4d3c76d93c08a (patch)
treeb94a661a8821aafe1cc6945ead210abc1349e3de /src/local
parentbcadca71a694c68263d03da27fcaf3fc897da38f (diff)
downloadchawan-f9433f13765ca6ec6aa5d2c34dd4d3c76d93c08a.tar.gz
timeout: accept err stream as param
gets rid of a todo. (not sure why I thought this was important, but it sure looks nicer)
Diffstat (limited to 'src/local')
-rw-r--r--src/local/client.nim9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 33bb44e3..6adc4a53 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -586,7 +586,7 @@ proc inputLoop(client: Client) =
client.handleWrite(efd)
if (event.revents and POLLERR) != 0 or (event.revents and POLLHUP) != 0:
client.handleError(efd)
- if client.timeouts.run():
+ if client.timeouts.run(client.console.err):
let container = client.consoleWrapper.container
if container != nil:
container.tailOnLoad = true
@@ -634,7 +634,7 @@ proc headlessLoop(client: Client) =
client.handleWrite(efd)
if (event.revents and POLLERR) != 0 or (event.revents and POLLHUP) != 0:
client.handleError(efd)
- discard client.timeouts.run()
+ discard client.timeouts.run(client.console.err)
client.runJSJobs()
client.loader.unregistered.setLen(0)
client.acceptBuffers()
@@ -754,10 +754,7 @@ proc launchClient*(client: Client; pages: seq[string];
client.hideConsole()
client.consoleWrapper = pager.addConsole(interactive = istream != nil,
clearFun, showFun, hideFun)
- #TODO passing console.err here makes it impossible to change it later. maybe
- # better associate it with jsctx
- client.timeouts = newTimeoutState(client.jsctx, client.console.err,
- evalJSFree2, client)
+ client.timeouts = newTimeoutState(client.jsctx, evalJSFree2, client)
client.pager.timeouts = client.timeouts
addExitProc((proc() = client.cleanup()))
if client.config.start.startup_script != "":