Mail Archives: cygwin/2007/04/03/17:45:19
* 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 -