about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/io')
-rw-r--r--src/io/term.nim6
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
lt'>
ec926027 ^





f1b71a44 ^
ca01193d ^
f1b71a44 ^
ec926027 ^





ca01193d ^
e2240eb4 ^
69e14325 ^
5eb49929 ^
e2240eb4 ^


ec926027 ^

7284d503 ^


8eff7919 ^

f1b71a44 ^
ec926027 ^
7c8493b3 ^

b75e94b3 ^
ec926027 ^
dcfca05e ^

f1b71a44 ^
dcfca05e ^
f89378d5 ^
f1a6f323 ^
9cf71627 ^
2199940a ^
dcfca05e ^

9cf71627 ^

dcfca05e ^
a767dbd3 ^
9cf71627 ^

7284d503 ^
64cf0a59 ^
69e14325 ^


df8bb4c3 ^
f6d47435 ^
5eb49929 ^



f1e953d0 ^
ec926027 ^

5eb49929 ^
b75e94b3 ^

ec926027 ^
8eff7919 ^
f6d47435 ^
f278a15d ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104