Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2000 11:11:31 -0600 (CST)
From:      Ryan Thompson <ryan@sasknow.com>
To:        freebsd-questions@freebsd.org
Subject:   bash line wrapping with ANSI colours
Message-ID:  <Pine.BSF.4.21.0004171057240.67131-100000@ren.sasknow.com>

next in thread | raw e-mail | index | archive | help

Hi all,

I've recently begun mucking around with my bash prompts lately, and, due
to the use of quite a lot of colour, PS1 has become quite long in
characters (though, when displayed, is only about 15 columns, plus the
path).

For some reason, with line editing enabled in bash, readline insists on
WRAPPING lines of text after I type only a few characters (my prompt
happens to be about 70 characters long, and I'm using a terminal with 80
columns)... Thus, after I type about 10 characters at the prompt (still
only on about terminal column 30), it wraps and messes with the
display.  Thus, it looks like bash figures out the wrapping boundary
WITHOUT first filtering out the ANSI escape sequences.

Granted, the terminal is responsible for interpreting the ANSI codes, but
is there a way to make bash ignore them before handling wrapping?

The wrapping doesn't happen if I use `set +o emacs` (thus turning off
readline in bash), but I don't want to lose the command line editing.  It
DOES still happen with -o vi, though.

Has this been documented before?  I couldn't find anything in the bash
manpage or the mailing lists like this.  It smells like a bug, but has
probably been around far too long to be called anything but a feature :-)

-- 
  Ryan Thompson <ryan@sasknow.com>
  Systems Administrator, Accounts
  Phone: +1 (306) 664-1161

  SaskNow Technologies     http://www.sasknow.com
  #106-380 3120 8th St E   Saskatoon, SK  S7H 0W2



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0004171057240.67131-100000>