title: Seeing escape characters when pressing the arrow keys in python shell
body: <p>In shells like the interactive python shell, you can usually use the arrow keys to move around in the current line or get previous commands (with arrow-up) etc.</p>
  
  <p>But after I ssh into another machine and start <code>python</code> there, I get sessions like:</p>
  
  <pre><code>&gt;&gt;&gt; import os 
  &gt;&gt;&gt; ^[[A    
  </code></pre>
  
  <p>where the last character comes from arrow-up. Or, using arrow-left:</p>
  
  <pre><code>&gt;&gt;&gt; impor^[[D
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>In the regular bash, arrow keys work fine. The weird behavior is just in the interactive python (or perl etc.) shell.</p>