term_size-rs icon indicating copy to clipboard operation
term_size-rs copied to clipboard

Expose ws_xpixel and ws_ypixel

Open swsnr opened this issue 4 years ago • 1 comments

winsize also exposes the window size of the terminal in pixels which supports image drawing (e.g. in Kitty).

Would you mind to expose it as well?

By the way, while looking at the sources of term_size I noticed that it defines TIOCGWINSZ on its own, even though the libc crate also defines it. I guess that's because the constant wasn't part of libc when term_size was initially written? Perhaps using the libc constant would fix #32 :thinking:

swsnr avatar Oct 16 '20 09:10 swsnr

I guess that's because the constant wasn't part of libc when term_size was initially written?

Either that or the authors wanted to avoid depending on libc just because of one constant. Either way, I would rather deprecate this crate in favor of termsize, see https://github.com/clap-rs/term_size-rs/pull/31

Perhaps using the libc constant would fix #32

Correct.


Expose ws_xpixel and ws_ypixe

Keep in mind that it needs to be accomplished in a cross-platform way, e.g the API it must work on both Windows and Linux. Can it be accomplished on Windows at all? If not, I think this API belongs to nix.

CreepySkeleton avatar Oct 16 '20 12:10 CreepySkeleton