Hacker News new | ask | show | jobs
by RobertMiller 1558 days ago
> But then creating TUIs now require as much complexity as creating single window GUIs (requiring handling events outside the program)

No way dude. All you need to do is catch SIGWINCH and then ioctl/TIOCGWINSZ to get the new size. Back when I was into roguelike development, responding to the terminal resizing took scarcely more than a half dozen lines of C. I wish I knew of a GUI system this simple.

1 comments

Most GUI systems handle redrawing and resizing for you. Likewise you may need to catch some events, but that's it. Which GUI are you talking about?
It's not redrawing/resizing with a GUI that's the matter, it's the whole of it. TUIs are easy to create without much investment in learning a whole GUI system.
That's assuming you find a TUI easier to deal with. I guess for the I-use-Arch crowd, sure, but anything more than just printing out lines of text IMO makes using VTs a pain. And if I'm just outputting text, using GTK or Qt is more than fine.