From f0de405c6614356928d8700e2e95d00d97ffe2f9 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 15 Dec 2022 18:59:18 +0100 Subject: Fix console display bugs, add container.location --- src/display/client.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/display/client.nim') diff --git a/src/display/client.nim b/src/display/client.nim index 34077055..5162d4aa 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -13,6 +13,7 @@ when defined(posix): import std/exitprocs import bindings/quickjs +import buffer/buffer import buffer/container import css/sheet import config/config @@ -123,9 +124,9 @@ proc command0(client: Client, src: string, filename = "", silence = fal free(ret) proc command(client: Client, src: string) = - restoreStdin(client.console.tty.getFileHandle()) client.command0(src) - client.console.container.cursorLastLine() + client.console.container.requestLines().then(proc() = + client.console.container.cursorLastLine()) proc quit(client: Client, code = 0) {.jsfunc.} = if client.alive: @@ -385,6 +386,7 @@ proc newConsole(pager: Pager, tty: File): Console = raise newException(Defect, "Failed to open file for console pipe.") result.err = newFileStream(f) result.err.writeLine("Type (M-c) console.hide() to return to buffer mode.") + result.err.flush() result.pager = pager result.tty = tty pager.registerContainer(result.container) @@ -448,6 +450,7 @@ proc show(console: Console) {.jsfunc.} = if console.pager.container != console.container: console.prev = console.pager.container console.pager.setContainer(console.container) + console.container.requestLines() proc hide(console: Console) {.jsfunc.} = if console.pager.container == console.container: -- cgit 1.4.1-2-gfad0