bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANSI color codes, etc?


From: Mike Pontillo
Subject: ANSI color codes, etc?
Date: Thu, 18 Jan 2001 15:36:42 -0800 (PST)

        Hello, maybe you guys can help me with this. I recently grabbed
the latest bash from gnu.org in hopes that it would fix a problem i was
having with bash-2.03.
        What's happening is that whenever I use a PS1 variable with ANSI
color codes or xterm control codes (<esc>]0;<term title><control-g>)
contained in it, the line warpping suddenly ceases to work. (I'll type a
few characters, and then bash will take me to the next line, etc; and it
causes all kinds of annoying editing errors.)
        Now, I was thinking that this was because the added characters
confuse the readline library into thinking that there are characters there
when they are really terminal control codes. I did some hacking around and
tried modifying the "display.c" file in readline (around lines 198-203) to
try to get it to ignore those characters in its count while it printed the
prompt. (I also tried surrounging my control codes in ^A and ^B
characters, as per mylimited understanding of how readline works) When
that didn't work, it made me realize that I should stop wasting time and
consult the experts. =) What do you guys think? Is it feasable to get bash
to ignore ANSI codes in the prompt? I'd really like to customize my PS1 so
it looks nice and does useful things (such as putting information in the
title bar of my xterm) but this problem has got me pulling my hair out.
        Suggestions? 

Thanks a lot,
Mike Pontillo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]