Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-14 Thread Paul van Tilburg
On Mon, Jun 13, 2005 at 05:42:15PM -0400, Daniel Jacobowitz wrote:
 On Mon, Jun 13, 2005 at 11:33:13PM +0200, Paul van Tilburg wrote:
  I am using Gnome Terminal mostly.  I do not seem to have the problem
  with xterm itself, but got the same with aterm when I set TERM to xterm
  instead of it's rxvt default.
  
  So for the moment I do TERM=rxvt when I launch a terminal as a work-around.
 
 Oho!  That would have been a good piece of information to have this
 morning; sorry I forgot to ask.  You were only talking about xterm.

Yes, sorry... one has xterm (the mode/terminfo) and xterm (the program).
But I tested with aterm as well.

 The sequence it is choking on is ESC (.  This shouldn't be there;
 tonight's mirror pulse will distribute libncurses5 5.4-6 for your
 architecture, and after that things should start to work again. 
 However, gnome-terminal may want to investigate the display bug further
 to improve compatibility with xterm.  If you can confirm that the new
 ncurses library fixes the problem for now, I'll reassign this bug.

Confirmed, it is resolved, many thanks!

 BTW, the reason you see your prompt twice is probably because you have
 precmd() and preexec() set to massage the terminal's title bar.  ^]]0;
 to ^G is a title string.

Duh, of course. Forget I ever mentioned it.

Thanks!

Paul

-- 
Student @ Eindhoven | email: [EMAIL PROTECTED]
University of Technology, The Netherlands   | JID: [EMAIL PROTECTED]
 Using the Power of Debian GNU/Linux  | GnuPG key ID: 0x50064181


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 09:45:00AM -0400, Daniel Jacobowitz wrote:
 The stray } is because %{ matches with %}.  Otherwise no visual
 glitches at all - IN THE PROMPT.  However, lstab puts the cursor way
 off in the wrong place.  Zsh's notion of the width of the prompt string
 is all wrong.  Specifically, it thinks it is twelve characters longer
 than it is, which corresponds exactly to the three ESC[0m sequences.

The twelve-character offset was due to the %{} typo in Paul's posted
PS1 string; if I correct it to %{%} then I have no problems with any of
the combinations I tried, so I'll need more information about this bug.
But since there's obviously a glitch in using the new ncurses-base with
the old libncurses, I'm tightening the dependencies.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Paul van Tilburg
On Mon, Jun 13, 2005 at 10:11:18AM -0400, Daniel Jacobowitz wrote:
 On Mon, Jun 13, 2005 at 09:45:00AM -0400, Daniel Jacobowitz wrote:
  Here's what it writes out for PS1=[EMAIL PROTECTED] :

 So that looks like the problem Thomas expected to see.  But it can't be
 the problem Paul was seeing, because I don't get a single stray
 ESC[27m.

My PS1=[EMAIL PROTECTED] 

I color my hostnames (%m) based on the hostname itself, so my prompt
code really is (if this is a zsh problem, but it didn't get updated the
last two days):

# Determine hostname color.
case `hostname` in
  speed)COLOR=ESC[30m ;;
[...etc..]
  power)COLOR=ESC[37m ;;
  *)COLOR=ESC[36m ;;
esac

# Prompts
PS1=[EMAIL PROTECTED] 

 Paul, could you show us exactly what you see?  I can produce that by
 running zsh inside of 'script', then exiting, and loading the
 typescript with 'less'.

I ran script, then ^d. I have attached is resulting typescript.

Paul

-- 
Student @ Eindhoven | email: [EMAIL PROTECTED]
University of Technology, The Netherlands   | JID: [EMAIL PROTECTED]
 Using the Power of Debian GNU/Linux  | GnuPG key ID: 0x50064181


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 05:30:10PM +0200, Paul van Tilburg wrote:
 On Mon, Jun 13, 2005 at 10:11:18AM -0400, Daniel Jacobowitz wrote:
  On Mon, Jun 13, 2005 at 09:45:00AM -0400, Daniel Jacobowitz wrote:
   Here's what it writes out for PS1=[EMAIL PROTECTED] :
 
  So that looks like the problem Thomas expected to see.  But it can't be
  the problem Paul was seeing, because I don't get a single stray
  ESC[27m.
 
 My PS1=[EMAIL PROTECTED] 
 
 I color my hostnames (%m) based on the hostname itself, so my prompt
 code really is (if this is a zsh problem, but it didn't get updated the
 last two days):
 
 # Determine hostname color.
 case `hostname` in
   speed)COLOR=ESC[30m ;;
 [...etc..]
   power)COLOR=ESC[37m ;;
   *)COLOR=ESC[36m ;;
 esac
 
 # Prompts
 PS1=[EMAIL PROTECTED] 

Aha!  There's the [27m I couldn't find.  I still haven't been able to
reproduce the problem; I just tried on PowerPC, with ncurses-base 5.4-5
and libncurses5 5.4-4 installed, and the current zsh.

  Paul, could you show us exactly what you see?  I can produce that by
  running zsh inside of 'script', then exiting, and loading the
  typescript with 'less'.
 
 I ran script, then ^d. I have attached is resulting typescript.

No attachment?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Paul van Tilburg
On Mon, Jun 13, 2005 at 12:46:21PM -0400, Daniel Jacobowitz wrote:
 On Mon, Jun 13, 2005 at 05:30:10PM +0200, Paul van Tilburg wrote:
  On Mon, Jun 13, 2005 at 10:11:18AM -0400, Daniel Jacobowitz wrote:
   On Mon, Jun 13, 2005 at 09:45:00AM -0400, Daniel Jacobowitz wrote:
Here's what it writes out for PS1=[EMAIL PROTECTED] :
  
   So that looks like the problem Thomas expected to see.  But it can't be
   the problem Paul was seeing, because I don't get a single stray
   ESC[27m.
  
  My PS1=[EMAIL PROTECTED] 
  
  I color my hostnames (%m) based on the hostname itself, so my prompt
  code really is (if this is a zsh problem, but it didn't get updated the
  last two days):
  
  # Determine hostname color.
  case `hostname` in
speed)COLOR=ESC[30m ;;
  [...etc..]
power)COLOR=ESC[37m ;;
*)COLOR=ESC[36m ;;
  esac
  
  # Prompts
  PS1=[EMAIL PROTECTED] 
 
 Aha!  There's the [27m I couldn't find.  I still haven't been able to
 reproduce the problem; I just tried on PowerPC, with ncurses-base 5.4-5
 and libncurses5 5.4-4 installed, and the current zsh.

I have been unable to do so on x86 machines as well.
Where do you see the [27m btw?

Btw, by creating a new dummy account (you can have one too if you need
it) with all defaults I still get:
[27mpower%

   Paul, could you show us exactly what you see?  I can produce that by
   running zsh inside of 'script', then exiting, and loading the
   typescript with 'less'.
  
  I ran script, then ^d. I have attached is resulting typescript.
 
 No attachment?

Sorry, cliche as it is, it happend again.

Paul

-- 
Student @ Eindhoven | email: [EMAIL PROTECTED]
University of Technology, The Netherlands   | JID: [EMAIL PROTECTED]
 Using the Power of Debian GNU/Linux  | GnuPG key ID: 0x50064181
Script started on Mon Jun 13 17:24:24 2005
]0;[EMAIL PROTECTED]:~
([EMAIL PROTECTED](%  ~


Script done on Mon Jun 13 17:24:26 2005


Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 07:32:40PM +0200, Paul van Tilburg wrote:
   My PS1=[EMAIL PROTECTED] 

 I have been unable to do so on x86 machines as well.
 Where do you see the [27m btw?

Right there?  In the first %{%}.

 Btw, by creating a new dummy account (you can have one too if you need
 it) with all defaults I still get:
 [27mpower%

If you cat the typescript in your terminal, do you see the [27?  Cuz, I
don't.

What is $TERM?  What is your xterm package version?  Are you using
screen?


-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 11:33:13PM +0200, Paul van Tilburg wrote:
 I am using Gnome Terminal mostly.  I do not seem to have the problem
 with xterm itself, but got the same with aterm when I set TERM to xterm
 instead of it's rxvt default.
 
 So for the moment I do TERM=rxvt when I launch a terminal as a work-around.

Oho!  That would have been a good piece of information to have this
morning; sorry I forgot to ask.  You were only talking about xterm.

I can reproduce it in gnome-terminal.  If this is a bug anywhere, it's
a bug in gnome-terminal; it needs to either be compatible with xterm,
or use a different value for $TERM.

The sequence it is choking on is ESC (.  This shouldn't be there;
tonight's mirror pulse will distribute libncurses5 5.4-6 for your
architecture, and after that things should start to work again. 
However, gnome-terminal may want to investigate the display bug further
to improve compatibility with xterm.  If you can confirm that the new
ncurses library fixes the problem for now, I'll reassign this bug.

BTW, the reason you see your prompt twice is probably because you have
precmd() and preexec() set to massage the terminal's title bar.  ^]]0;
to ^G is a title string.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey
Here's the script in readable form (using unmap from my ncurses ftp area):

Script started on Mon Jun 13 17:24:24 2005
\n
\E]0;[EMAIL PROTECTED]:~^G\r
\E[0m
\E(
\E[27m
\E[24m
\E[Jpaul@
\E[1m
\E[37mpower
\E[0m
\E(
\E[0m% 
\E[K
\E[80C ~
\E[82D
\E[K\r\r
\n
\nScript done on Mon Jun 13 17:24:26 2005
\n

The problem is that with the older ncurses before the fix mentioned for

20040710
...
+ modify logic in tgetent() which adjusts the termcap me string  
  to work with ISO-2022 string used in xterm-new (cf: 20010908).   
...
20040626
...
  + modify xterm-new aka xterm-xfree86 to accommodate luit, which  
relies on G1 being used via an ISO-2022 escape sequence (report by 
Juliusz Chroboczek)

ncurses could only successfully chop out a single byte from the sgr0 string
(a fix made to allow screen to work properly).  sgr0 for xterm-new is

sgr0=\E(B\E[m, 

though this is also common (and equivalent)

sgr0=\E[m\E(B, 

The example of the prompt above is probably the latter.  Rather than
removing \E(B, ncurses removed only B.

The 27m's come about because of the way xterm handles errors.  It's
predictable.

\E(
\E[27m

is missing the final character for \E(, so the next \E goes to an
error state, leaving the [27m printable.

-- 
Thomas E. Dickey [EMAIL PROTECTED]
http://invisible-island.net
ftp://invisible-island.net


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 07:50:37PM -0400, Thomas E. Dickey wrote:
 The example of the prompt above is probably the latter.  Rather than
 removing \E(B, ncurses removed only B.
 
 The 27m's come about because of the way xterm handles errors.  It's
 predictable.
 
 \E(
 \E[27m
 
 is missing the final character for \E(, so the next \E goes to an
 error state, leaving the [27m printable.

Ohhh... I get it now.  So the bug is just that gnome-terminal's error
recovery is different from xterm's.

In that case I'll close this bug in a day or two.  The new version of
ncurses-base will prevent this from reoccuring.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


1) My own stupid fault; I messed up the upload so it has not autobuilt
for other architectures, including PowerPC.  I will fix that now.

2) The dependencies in ncurses-base do not prevent using it with the
old library; is this compatibility problem big enough to justify that
(annoying) change?


Actually it hadn't occurred to me that someone would have (after upgrade)
an older ncurses library and a newer terminfo.  While ncurses-base doesn't
have to require ncurses (slang may use it, right?), it would be nice if
upgrading ncurses-base would also upgrade the library when it's installed.

But ncurses library is required, right?

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 08:06:36PM -0400, Thomas E. Dickey wrote:
 On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:
 
 I can reproduce it in gnome-terminal.  If this is a bug anywhere, it's
 a bug in gnome-terminal; it needs to either be compatible with xterm,
 or use a different value for $TERM.
 
 gnome-terminal does have its problems, but the bug we're talking about
 is a bug in ncurses that was fixed last year...

Isn't it a bug (however marginal) if gnome-terminal and xterm handle
the same control sequences differently?  The file Paul sent me displays
fine in a real xterm, despite the extra control sequence.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


I can reproduce it in gnome-terminal.  If this is a bug anywhere, it's
a bug in gnome-terminal; it needs to either be compatible with xterm,
or use a different value for $TERM.


gnome-terminal does have its problems, but the bug we're talking about
is a bug in ncurses that was fixed last year...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


On Mon, Jun 13, 2005 at 08:06:36PM -0400, Thomas E. Dickey wrote:

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


I can reproduce it in gnome-terminal.  If this is a bug anywhere, it's
a bug in gnome-terminal; it needs to either be compatible with xterm,
or use a different value for $TERM.


gnome-terminal does have its problems, but the bug we're talking about
is a bug in ncurses that was fixed last year...


Isn't it a bug (however marginal) if gnome-terminal and xterm handle
the same control sequences differently?  The file Paul sent me displays
fine in a real xterm, despite the extra control sequence.


oh that gnome-terminal doesn't use a state machine - it uses random 
logic (several switch statements tied together with ad hoc logic). 
Actually that's what most of the terminal emulators do.  A hardware 
terminal would probably use a state machine, since it's compact.


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


But ncurses library is required, right?


Right.  Actually, it looks like I may have goofed: ncurses-base is
Essential, and libncurses5 wasn't.  I'll talk to the release managers.


ok.  It's not the usual sort of bug.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Daniel Jacobowitz
On Mon, Jun 13, 2005 at 08:10:19PM -0400, Thomas E. Dickey wrote:
 On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:
 
 1) My own stupid fault; I messed up the upload so it has not autobuilt
 for other architectures, including PowerPC.  I will fix that now.
 
 2) The dependencies in ncurses-base do not prevent using it with the
 old library; is this compatibility problem big enough to justify that
 (annoying) change?
 
 Actually it hadn't occurred to me that someone would have (after upgrade)
 an older ncurses library and a newer terminfo.  While ncurses-base doesn't
 have to require ncurses (slang may use it, right?), it would be nice if
 upgrading ncurses-base would also upgrade the library when it's installed.
 
 But ncurses library is required, right?

Right.  Actually, it looks like I may have goofed: ncurses-base is
Essential, and libncurses5 wasn't.  I'll talk to the release managers.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#313352: Recent update broke xterm compability with zsh/prompt

2005-06-13 Thread Thomas Dickey

On Mon, 13 Jun 2005, Daniel Jacobowitz wrote:


Ohhh... I get it now.  So the bug is just that gnome-terminal's error
recovery is different from xterm's.


right.


In that case I'll close this bug in a day or two.  The new version of
ncurses-base will prevent this from reoccuring.


thanks.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]