johnnovak / illwill

A curses inspired simple cross-platform console library for Nim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Fire terminal resize events.

enthus1ast opened this issue · comments

For windows (WINDOW_BUFFER_SIZE_EVENT):
https://docs.microsoft.com/en-us/windows/console/reading-input-buffer-events

For linux (SIGWINCH)

As a fallback:

var oldDimenions = terminalSize()
tb = newTerminalBuffer()
if oldDimenions != terminalSize():
  tb = newTerminalBuffer(terminalSize().w, terminalSize().h)
  oldDimenions = terminalSize()

PRs are welcome :) I just always redraw in my apps in every main loop iteration, that works too.

Closing due to inactivity/lack of interest.