increase term scroll back, misc functions stolen from internet