ipython/ipython — pull request #1089 by mdboom (2011-12-02 16:23:36+00:00)
Title: Support carriage return ('\r') and beep ('\b') characters in the qtconsole

This addresses the bug in #629.

It extends AnsiCodeProcessor to understand the '\r' character and move the cursor back to the start of the line. It also understands the '\b' character and calls QTApplication::beep(). Neither are strictly speaking ANSI code sequences, of course, but they seem related enough and was simple enough to do it this way.

Here's a "poor man's scrollbar" function to help test this:

```
def scrollbar():
import sys
import time
for i in range(80):
print '\r' + ('=' * i),
sys.stdout.flush() # required for regular console
time.sleep(0.1)
print '\b'
```