add --end-of-stream to history. if history contains --end-of-stream on playback, close even if stream='true' and don't write --end-of-history