delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/03/17:45:19

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Thorsten Kampe <thorsten AT thorstenkampe DOT de>
Subject: Re: Escape colour codes
Date: Tue, 3 Apr 2007 22:44:26 +0100
Lines: 41
Message-ID: <euuhri$f63$1@sea.gmane.org>
References: <etlt2v$aq0$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: MicroPlanet-Gravity/2.70.2067
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019