class RatatuiRuby::Backend::WindowSize
Terminal window dimensions in characters and pixels.
Some operations need both character grid size and pixel dimensions. Sixel graphics, image rendering, and precise layout calculations all benefit from knowing both measurements at once.
This struct bundles both sizes together. It matches upstream Ratatuiās backend::WindowSize struct exactly.
Both fields are Layout::Size instances. This reuses the same type for character and pixel dimensions, matching upstream design.
Note: Pixel dimensions may be zero on some systems. Unix marks these fields āunusedā in TIOCGWINSZ. Windows does not implement them.
Example
ws = RatatuiRuby::Terminal.window_size if ws puts "#{ws.columns_rows.width}x#{ws.columns_rows.height} chars" puts "#{ws.pixels.width}x#{ws.pixels.height} pixels" end
Attributes
Size of the window in characters (columns/rows) as Layout::Size.
Size of the window in pixels as Layout::Size.