fix overwriting of previous lines in term