Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show text in the center of terminal screen in golang

Tags:

terminal

go

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?

like image 294
Ondra Avatar asked May 14 '13 14:05

Ondra


1 Answers

A terminal package exists in the Go crypto repository: In particular, check out the GetSize function

like image 85
ctn Avatar answered Oct 10 '22 18:10

ctn