diff options
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 |