diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-21 23:31:29 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-21 23:31:29 +0100 |
commit | bd8e806b04b024f916b274650185c3480d3cff36 (patch) | |
tree | 2076cd4525a1d2672ff6986ae3fea9b1d364a13b /src/display/client.nim | |
parent | 95444650537805d414deec706ad98e37df8b88db (diff) | |
download | chawan-bd8e806b04b024f916b274650185c3480d3cff36.tar.gz |
Termcap support (?)
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/display/client.nim b/src/display/client.nim index add5dfbc..9ef501ab 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -264,16 +264,20 @@ proc newConsole(pager: Pager, tty: File): Console = raise newException(Defect, "Failed to open file for console pipe.") result.err = newFileStream(f) result.pager = pager + result.tty = tty else: result.err = newFileStream(stderr) proc launchClient*(client: Client, pages: seq[string], ctype: Option[string], dump: bool) = var tty: File + var dump = dump if not dump: if stdin.isatty(): tty = stdin elif stdout.isatty(): discard open(tty, "/dev/tty", fmRead) + else: + dump = true client.pager.launchPager(tty) client.console = newConsole(client.pager, tty) let pid = getpid() @@ -296,7 +300,7 @@ proc launchClient*(client: Client, pages: seq[string], ctype: Option[string], du for page in pages: client.pager.loadURL(page, ctype = ctype) - if stdout.isatty() and not dump: + if not dump: client.inputLoop() else: for msg in client.pager.status: |