diff options
author | bptato <nincsnevem662@gmail.com> | 2021-12-15 23:05:44 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-12-15 23:05:44 +0100 |
commit | 897448a291efe54676a1f4a54676a96edff5c967 (patch) | |
tree | 183d488e9c1c8f3a99a9514c98ab1e511a57a706 /src/io | |
parent | bc1aceb8d8060bc45d352cd9f411b9976044641c (diff) | |
download | chawan-897448a291efe54676a1f4a54676a96edff5c967.tar.gz |
Length unit fixes
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/term.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/io/term.nim b/src/io/term.nim index dc54a34c..a51b2a56 100644 --- a/src/io/term.nim +++ b/src/io/term.nim @@ -8,6 +8,8 @@ type height*: int ppc*: int ppl*: int + width_px*: int + height_px*: int proc getTermAttributes*(): TermAttributes = if stdin.isatty(): @@ -16,6 +18,8 @@ proc getTermAttributes*(): TermAttributes = if ioctl(cint(getOsFileHandle(stdout)), TIOCGWINSZ, addr win) != -1: result.width = int(win.ws_col) result.height = int(win.ws_row) + result.width_px = int(win.ws_xpixel) + result.height_px = int(win.ws_ypixel) result.ppc = int(win.ws_xpixel) div int(win.ws_col) result.ppl = int(win.ws_ypixel) div int(win.ws_row) return @@ -26,3 +30,5 @@ proc getTermAttributes*(): TermAttributes = result.height = 24 result.ppc = 9 result.ppl = 18 + result.width_px = result.ppc * result.width + result.height_px = result.ppl * result.height |