Escape sequences unprocessed under the "cygwin" terminal
<p>I have a Java application which uses <a href="https://en.wikipedia.org/wiki/ANSI_escape_code" rel="nofollow">ANSI escape sequences</a> to display colours, position the cursor, etc.</p>

<p>It works fine under regular Unices,
and also under <code>xterm</code> and <code>mintty</code>(in <em>Cygwin</em>),
but I'm having trouble running it under the <code>cygwin</code> terminal (i. e. <code>bash</code> launched from <code>cmd.exe</code>).</p>

<p>As you can see from the screen shot:</p>

<p><a href="https://i.stack.imgur.com/Ohg41.png" rel="nofollow"><img src="https://i.stack.imgur.com/Ohg41.png" alt="enter image description here"></a></p>

<p>escape sequences are output "as is", without processing. On the other hand, I can easily run smth like <code>echo -e '\033[1;31mTest'</code> -- and colour text will be just there.</p>

<p>At the same time, if I launch exactly the same application from a <a href="https://www.midnight-commander.org/" rel="nofollow"><em>Midnight Commander</em></a> subshell, escape sequences produced by the application will be interpreted correctly:</p>

<p><a href="https://i.stack.imgur.com/jV7UW.png" rel="nofollow"><img src="https://i.stack.imgur.com/jV7UW.png" alt="enter image description here"></a></p>

<p>Also, if I log in to my Windows box using SSH (i. e. replace the local connection with the remote one, but retain the same <code>cygwin</code> terminal), again, escape sequences are processed just fine.</p>

<p>It looks like when a subshell of some kind is created (<code>mc</code> or <code>ssh</code>), the terminal is put into some other mode. But playing with <code>stty</code> wasn't helpful, nor was export'ing <code>TERM=ansi</code>.</p>

<p>Could anyone please suggest any solution?</p>

<p>I'm running</p>

<pre><code>CYGWIN_NT-6.3 UNIT-725 2.5.1(0.297/5/3) 2016-04-21 22:14 x86_64 Cygwin
</code></pre>

<p>and Windows 8.1.</p>