Add terminal overflow handling