X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: Re: Escape colour codes Date: Tue, 3 Apr 2007 22:44:26 +0100 Lines: 41 Message-ID: References: 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 * Thorsten Kampe (Mon, 19 Mar 2007 11:44:30 -0000) > I'm having a problem with colour escape codes for prompts in different > applications and terminals. Basically it is like this. > > lftp and yafc show a wrong prompt in the following terminals: cmd, 4nt, > console and far manager. Basically each coloured part of the prompt is > surrounded by two "funny faces" - the first is white and the second has > the desired colour. > > Let's say my prompt is "user AT host:directory" where "directory" is cyan. > Then the prompt looks like this[1]: > user AT host:[FW][FC]directory[FC][FW] > > The interesting thing is that the coloured prompts /do/ work in bash, zsh > and screen[2] with cmd, 4nt, console and FAR manager. > > Also the coloured prompts from lftp and yafc show correctly in rxvt. They > also show correctly in Linux and Konsole so the syntax of the coloured > prompt is correct. Well, I never got no answer so I had to solve this myself: IPython has the same problem and the reason is that the prompts are wrapped in \001 \002 pairs so "readline can properly know the length of each line and can wrap lines accordingly". Obvioulsy all Windows terminals can't interpret those "non-visible characters" (or they don't ignore them like they should or readline doesn't "eat" them like it should). Where is the culprit here? Cygwin readline not correctly interacting with non Cygwin terminals? Windows terminals not understanding common readline(?) escape characters? Is there a way to solve the issue? Patching Windows cmd is out of question so either readline had to be patched (if involved) or all the applications using those "\001 (^A) start non-visible characters, \002 (^B) end non-visible characters". 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/