Fix throwing exception when console windows is small on Linux.

It's a quick fix. A good solution would be to create a full
console interface: cleaning the full windows and controling what
it is drawn on it.