public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* odd bash wrapping due to ansi codes
@ 2000-09-17  2:07 Chris Abbey
  2000-09-19  7:10 ` Robert Praetorius
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Abbey @ 2000-09-17  2:07 UTC (permalink / raw)
  To: cygwin

environment is a clean install of 1.1.4 from the "latest"
as of 7 Sept, window is set to 132 columns wide, $COLUMNS is
also set to 132. PS1 is set to:
'<0x1b>]0;\w<0x07><0x1b>[1m<0x1b>[34m\w<0x1b>[0m $ '

cd /tmp
mkdir -p 
one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/eighteen/nineteen/twenty/twentyone/

{wrapping bug #1: mkdir command is wrapped between x and t of sixteen,
at column 110}

cd one/
cd two/
cd ...

repeating this by means of: "up arrow, esc, backspace, tab, enter"

after cd ten you'll see wrapping bug #1b,
   command is wrapped at column 61

after cd eleven you'll see wrapping bug #2,
   prompt is wrapped at column 58

each cd after that you'll see the prompt is
   wrapped *earlier* than before

until after cd eighteen, when it tries to wrap at
   a negative column and the result is some binary
   looking junk in the prompt. This is also the point
   where the titlebar stops being in sync; it appears
   that from here forward each prompt begins with the
   trailing junk that's been truncated from the titlebar.

if the titlebar manipulations are removed from PS1 then
everything goes well up until cd eighteen and nineteen,
where there are some issue with crlfs being left out, but
once you get past there then the prompt is properly wrapped
and everything is ok.

if all ansi codes are removed (PS1='\w $') then there are
no problems at all.



On a related note:

the default /etc/profile sets up these ansi codes by
default for all terminals, I'd suggest that at the bare
minimum these be skipped if the term type is incapable.

I've set mine up as:

if [ "$TERM" == "cygwin" ]; then
	PS1='' #cygwin version with ansi codes
else
	PS1='\w $'
fi
export PS1

and as long as I'm in that file, I just saw the other
patch I put in my copy....

if [ "$SHELL" != "/bin/bash" ]; then
	test -f ./.profile && . ./.profile
	test -f ./.bashrc && . ./.bashrc
fi

this has the advantage for those who run bash of not
sourcing these files twice, as bash does so itself.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-10-01  3:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-17  2:07 odd bash wrapping due to ansi codes Chris Abbey
2000-09-19  7:10 ` Robert Praetorius
2000-09-19 20:36   ` [patch] " Chris Abbey
2000-09-19 21:23     ` Randall R Schulz
2000-09-19 22:24       ` Chris Abbey
2000-09-20  5:58         ` Andreas Eibach
2000-09-25 13:42       ` DJ Delorie
2000-09-25 18:20     ` DJ Delorie
2000-10-01  0:43       ` Chris Abbey
2000-10-01  3:34         ` [RE-patch] " Chris Abbey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).