title: Visible ANSI escape sequences when running Emacs shell (these are not ANSI colors)
body: <p>When I run a shell command in Emacs, I often see what look like ANSI codes. They seem to happen when the shell process spawns a new process.</p>
  
  <p>Here's an example from running Stata in an Emacs shell. The ANSI codes (if this is what they are) are visible at the bottom:</p>
  
  <pre><code>. ls *.tex
  ls *.tex
  
  -rw-r--r--  1 pnj  staff  78006 Jun 23 17:21 un_paper.tex
  -rw-r--r--  1 pnj  staff   1821 Dec 22  2013 un_results.tex
  
  . shell ls *.tex
  shell ls *.tex
  
  ^[[?1l^[&gt;un_paper.tex                    un_results.tex
  ^[[?1h^[=
  .
  </code></pre>
  
  <p>Note: There are many similar SO questions about ANSI color escape sequences. This is not my problem! I already have required <code>ansi-color</code>, and <code>ansi-color-for-comint-mode-on</code>, and ANSI colors are working. Also, using ansi-term solves this problem, but I much much much prefer the buffer-like characteristics of the standard shell. eshell does slightly better but still displays some escape codes.</p>
  
  <p>My guess is that these are screen mode / cursor movement codes, but I can't figure out how to get emacs to either ignore or process them. TERM is set to xterm-256color.</p>
  
  <p>Update: I learned that the h and l codes are used for setting terminal/display mode, which I presume Emacs cannot process. Is there a way I can suppress them from being displayed?</p>