struct

Termisu::Event::Resize

Inherits Struct / Value / Object

Terminal resize event.

Generated when the terminal window size changes (SIGWINCH). Optionally includes previous dimensions for incremental resize handling.

Example:

event = termisu.poll_event
if event.is_a?(Termisu::Event::Resize)
  puts "Terminal resized to #{event.width}x#{event.height}"
  if event.changed?
    puts "Changed from #{event.old_width}x#{event.old_height}"
  end
  termisu.sync # Force full redraw
end

Constructors

new(width : Int32, height : Int32, old_width : Int32 | Nil = nil, old_height : Int32 | Nil = nil)
Source

Instance methods

changed?

Returns true if the dimensions have changed from previous values.

Returns true if:

  • Previous dimensions are unknown (nil)
  • Width or height differs from previous values
Source
height

New terminal height in rows.

Source
old_height

Previous terminal height in rows (nil if unknown or first resize).

Source
old_width

Previous terminal width in columns (nil if unknown or first resize).

Source
width

New terminal width in columns.

Source