This should not effect to the data to store. I just need to filter out unused characters including "\r" itself in output stream before inserting it. See also the PRs for the web interface: - https://github.com/ipython/ipython/pull/1674 - https://github.com/ipython/ipython/pull/1659