I am playing with golang and want to create a simple terminal tool (on mac, but it should work on linux too). I need to display character "x" in the center of the terminal window. How can I detect width and height of terminal window and detect its changes?
2 Answers
A lightweight alternative to the usual ncurses option, is termbox-go. This is a pure-go implementation of termbox.
It offers a simple API to get some 'graphical' stuff done in a terminal and is pretty decent as far as support for different terminal implementations goes.