lib/reterm/resize.rb
# Internal helper to track size of terminal.
# This is a simple mechanism that launches a
# worker thread to periodically poll terminal size.
Internal helper to track size of terminal.
This is a simple mechanism that launches a
worker thread to periodically poll terminal size.
Internal helper to track size of terminal . This is a simple mechanism that launches a worker thread to periodically poll terminal size .
def track_resize
    @track_resize = true
    d = Terminal.dimensions
    @resize_thread = Thread.new {
      while @track_resize
        Terminal.reset!
        t = Terminal.dimensions
        if t != d && !shutdown?
          Terminal.resize!
          @on_resize.call if !!@on_resize
        end
        d = Terminal.dimensions
        sleep(RESIZE_TIME)
      end
    }
  end
def track_resize @track_resize = true d = Terminal . dimensions @resize_thread = Thread . new { while @track_resize Terminal . reset! t = Terminal . dimensions if t != d && ! shutdown? Terminal . resize! @on_resize . call if ! ! @on_resize end d = Terminal . dimensions sleep ( RESIZE_TIME ) end } end
Internal helper to track size of terminal.
Internal helper to track size of terminal .