diff options
author | bptato <nincsnevem662@gmail.com> | 2025-01-22 20:55:13 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-01-22 20:55:13 +0100 |
commit | d0c60a0c06cef3bcf4e307eebfdda715ab67fc00 (patch) | |
tree | 27d8146129449dcd0de81456d61822f961aa7689 /src/main.nim | |
parent | d1b6b305ac6460d319f48c8b647347eb9bf8435d (diff) | |
download | chawan-d0c60a0c06cef3bcf4e307eebfdda715ab67fc00.tar.gz |
pager, term: replace execCmd, File
pager: I want to change mailcap command parsing, so a custom implementation is needed. term: now it uses a custom buffer for the output stream too. I don't think there is much difference in performance, but stdio was in the way. (Also, this way it will be easier to make it async in the future.)
Diffstat (limited to 'src/main.nim')
-rw-r--r-- | src/main.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.nim b/src/main.nim index 49693aab..e58397fe 100644 --- a/src/main.nim +++ b/src/main.nim @@ -254,7 +254,8 @@ proc main() = stderr.writeLine(res.error) quit(1) var history = true - if ctx.pages.len == 0 and stdin.isatty(): + let ps = newPosixStream(STDIN_FILENO) + if ctx.pages.len == 0 and ps.isatty(): if ctx.visual: ctx.pages.add(config.start.visualHome) history = false @@ -265,7 +266,7 @@ proc main() = ctx.pages.add(wwwHome) history = false if ctx.pages.len == 0 and not config.start.headless: - if stdin.isatty(): + if ps.isatty(): help(1) # make sure tmpdir exists discard mkdir(cstring(config.external.tmpdir), 0o700) |