[SP] Fix up input buffer management with history in viewlog.
[MP] Fix up input buffer management with history in viewlog.