X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: Re: Escape colour codes Date: Thu, 5 Apr 2007 08:30:59 +0100 Lines: 33 Message-ID: References: <4613A562 DOT 5090806 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com * Eric Blake (Wed, 4 Apr 2007 19:50:24 +0000 (UTC)) > Thorsten Kampe thorstenkampe.de> writes: > > 9. Install Python and IPython (http://ipython.scipy.org/moin/) > > set > > prompt_in1 '\C_White[\#\C_White]\C_LightCyan>>> ' > > prompt_out '\C_White[\N\C_White] ' > > in your ipythonrc and start IPython. Type 1 [Enter] > > The bug is in IPython. > > > 12. Remove the \001/\002 constructs in line 88 and 89 from > > ColorANSI.py in Cygwin IPython > > > > from > > Normal = '\001\033[0m\002' # Reset normal coloring > > _base = '\001\033[%sm\002' # Template for all other colors > > > > to > > > > Normal = '\033[0m' # Reset normal coloring > > _base = '\033[%sm' # Template for all other colors > > I'm not sure if this is correct. If you pass invisible characters to readline > without marking them as such, using \1 and \2, then readline messes up the > display width. The "from" is the original code, the "to" is my modification to show that omitting the \001/\002 constructs will make IPython not show the colour escape codes. Of course this wasn't meant as a solution because the escapes are there for a reason (as you correctly pointed out). Simply removing them will just introduce a new kind of problem. Thorsten -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/