Closed Awatatah closed 6 years ago
Yes, you can use tty-screen to get current width and height of the terminal window. Calculate the center point and then use tty-cursor to position the text on your screen. See star wars logo example on how it works.
Alternatively, you can use strings to align multiline strings together with tty-screen
gem to provide current width for the center alignment.
Just asking if there is a way to center the text in the terminal