width and height of the terminal window must be calculated every time
the terminal window is resized, not only the first time the getWidth and
getHeight methods are executed