Commit Graph

4 Commits

Author SHA1 Message Date
Benjamin Grosse
10c54b0056
Add window_size() for unix (#790)
It is possible to render images in terminals with protocols such as Sixel,
iTerm2's, or Kitty's. For a basic sixel or iTerm2 image printing, it is
sufficient to print some escape sequence with the data, e.g. cat image just
works, the image is displayed and enough lines are scrolled.

But for more sophisticated usage of images, such as TUIs, it is necessary to
know exactly what area that image would cover, in terms of columns/rows of
characters. Then it would be possible to e.g. resize the image to a size that
fits a col/row area precisely, not overdraw the image area, accommodate layouts,
etc.

Thus, provide the window size in pixel width/height, in addition to cols/rows.

The windows implementation always returns a "not implemented" error. The
windows API exposes a font-size, but in logical units, not pixels.

This could be further extended to expose either "logical window size",
or "pixel font size" and "logical font size".
2023-08-05 15:34:27 +02:00
Timon
0c20590774
0.24 (#686) 2022-07-02 21:39:25 +02:00
Timon
645685641a Clarify that SetSize resizes the terminal buffer. 2022-06-30 20:30:36 +02:00
Timon
58ef32b40a
Is terminal a tty and reverted feature from 0.17 which introduced a bug. (#405) 2020-03-28 18:38:07 +01:00