improved output, works when term buffer is full