about summary refs log tree commit diff stats
path: root/src/io/term.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/term.nim')
-rw-r--r--src/io/term.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io/term.nim b/src/io/term.nim
index d1cacf7c..838ba77a 100644
--- a/src/io/term.nim
+++ b/src/io/term.nim
@@ -17,12 +17,12 @@ proc getTermAttributes*(): TermAttributes =
     when defined(posix):
       var win: IOctl_WinSize
       if ioctl(cint(getOsFileHandle(stdout)), TIOCGWINSZ, addr win) != -1:
+        result.ppc = int(win.ws_xpixel) div int(win.ws_col)
+        result.ppl = int(win.ws_ypixel) div int(win.ws_row)
         result.width = int(win.ws_col) - 1
         result.height = int(win.ws_row)
-        result.width_px = int(win.ws_xpixel)
+        result.width_px = int(win.ws_xpixel) - result.ppc
         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)
         result.cell_ratio = result.ppl / result.ppc
         return
   #fail
'n106' href='#n106'>106 107 108 109 110 111 112 113 114