Fix remaining console height calculation bugs and ensure that at least 3 lines are visible.