mattn / go-tty

MIT License
208 stars 18 forks source link

added function for getting terminal size in pixels #21

Closed srlehn closed 5 years ago

srlehn commented 5 years ago

added function SizePixel() int, int, int, int, error for getting terminal size in pixels. The first, second and fifth return value are the same as the ones from Size() with the addition of the third and fourth being the terminal size in pixels.

The size() function for Unix already gets those values but disregards them. I would like to change this. For Windows and Plan 9 the values are set to -1 and an error would be returned.

The change would make go-tty more useful for usage in combination with sixel graphics.

This is only a suggestion for https://github.com/mattn/go-tty/issues/18.

mattn commented 5 years ago

please make sure that your change can be compiled. As far as I can see, your patch is broken.

srlehn commented 5 years ago

fixed

mattn commented 5 years ago

Looks good to me. How do you think? @zetamatta

hymkor commented 5 years ago

I tested it with my app using go-tty, and I think there are no problems.

mattn commented 5 years ago

Thanks!