Modified how to get the terminal size.