How can you clear or overwrite a line of text in DrRacket?
<p>I would like to display text and then overwrite it (for simple progress bars, etc.).  The usual trick of displaying a carriage return (<code>"\r"</code>) works fine when running Racket in the terminal in Linux and Windows, but in DrRacket and GRacket the carriage return does not seem to move the cursor to the beginning of the line.  </p>

<p>With this code as an example:</p>

<pre><code>(for ([x 5])
  (display "\r")
  (display x)    
  (flush-output) ; The result is the same with or without this line
  (sleep 0.1))
</code></pre>

<p>Running in the terminal results in a counter that overwrites itself; at the end only <code>4</code> is displayed in the terminal.  </p>

<p>Running in DrRacket results in the numbers displaying and not being overwritten:</p>

<pre><code>0
1
2
3
4
</code></pre>

<p>Is there a way to overwrite a line of text in the interactions window of DrRacket?</p>