zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#134474: zsh misbehaves if LINES=2
       [not found] <E16cYRl-00039Y-00@silk.kitenet.net>
@ 2002-02-18  1:55 ` Clint Adams
  2002-02-21  6:50   ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Clint Adams @ 2002-02-18  1:55 UTC (permalink / raw)
  To: Zsh-workers; +Cc: Joey Hess, 134474-forwarded

> As you probably know, my zsh prompt sets the xterm title. Well, this
> seems to not work in an xterm that is sized to 80x2. Updates to the
> title, which should happen every time the prompt is displayed, do not.
> Also weird is that, for root, I underline the username in the prompt,
> and this too does not happen in such a small xterm.
> 
> If I export LINES=10 in such a small xterm though, all the prompt stuff
> right away starts to work the same way it does in a larger xterm. Of
> course, this is liable to break other stuff..
> 
> My guess is that zsh is doing some kind of trimming of the prompt it
> displays if the terminal seems to be too small to contain the whole
> thing, or something like that.

Yes, it considers the terminal to be short if it's under 3 lines long;
what I don't understand is why it's eliding everything within %{ %}.
(If you get rid of these delimeters, which you almost certainly don't
want to do, it will set the xterm title as expected).


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

* Re: Bug#134474: zsh misbehaves if LINES=2
  2002-02-18  1:55 ` Bug#134474: zsh misbehaves if LINES=2 Clint Adams
@ 2002-02-21  6:50   ` Bart Schaefer
  2004-07-23 18:04     ` Clint Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2002-02-21  6:50 UTC (permalink / raw)
  To: Clint Adams, Zsh-workers; +Cc: Joey Hess, 134474-forwarded

On Feb 17,  8:55pm, Clint Adams wrote:
} Subject: Re: Bug#134474: zsh misbehaves if LINES=2
}
} > As you probably know, my zsh prompt sets the xterm title. Well, this
} > seems to not work in an xterm that is sized to 80x2. Updates to the
} > title, which should happen every time the prompt is displayed, do not.
} > 
} > My guess is that zsh is doing some kind of trimming of the prompt it
} > displays if the terminal seems to be too small to contain the whole
} > thing, or something like that.
} 
} Yes, it considers the terminal to be short if it's under 3 lines long;
} what I don't understand is why it's eliding everything within %{ %}.

This is from SINGLE_LINE_ZLE mode, which is automatically turned on when
LINES becomes too small, and is done by singlerefresh() rather than by
the prompt code.  The right-side prompt is turned off in this case as
well.  This is (sort of, not well) documented in "man zshzle".

However, the prompt code disables termcap sequences like underlining on
short terminals; see Src/prompt.c:tsetcap().  This is probably done in
support of SINGLE_LINE_ZLE, but if so I think it ought to be based on
the option setting rather than on (termflags & TERM_SHORT).

Geoff?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: Bug#134474: zsh misbehaves if LINES=2
  2002-02-21  6:50   ` Bart Schaefer
@ 2004-07-23 18:04     ` Clint Adams
  2004-07-26  2:25       ` Geoff Wing
  0 siblings, 1 reply; 5+ messages in thread
From: Clint Adams @ 2004-07-23 18:04 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh-workers, 134474

> This is from SINGLE_LINE_ZLE mode, which is automatically turned on when
> LINES becomes too small, and is done by singlerefresh() rather than by
> the prompt code.  The right-side prompt is turned off in this case as
> well.  This is (sort of, not well) documented in "man zshzle".
> 
> However, the prompt code disables termcap sequences like underlining on
> short terminals; see Src/prompt.c:tsetcap().  This is probably done in
> support of SINGLE_LINE_ZLE, but if so I think it ought to be based on
> the option setting rather than on (termflags & TERM_SHORT).
> 
> Geoff?

Like this?

Index: Src/prompt.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prompt.c,v
retrieving revision 1.19
diff -u -r1.19 prompt.c
--- Src/prompt.c	22 Jun 2004 13:10:02 -0000	1.19
+++ Src/prompt.c	23 Jul 2004 18:03:59 -0000
@@ -746,7 +746,7 @@
 mod_export void
 tsetcap(int cap, int flag)
 {
-    if (!(termflags & TERM_SHORT) && tcstr[cap]) {
+    if (!isset(SINGLE_LINE_ZLE) && tcstr[cap]) {
 	switch(flag) {
 	case -1:
 	    tputs(tcstr[cap], 1, putraw);


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

* Re: Bug#134474: zsh misbehaves if LINES=2
  2004-07-23 18:04     ` Clint Adams
@ 2004-07-26  2:25       ` Geoff Wing
  2004-08-03 15:46         ` Clint Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Wing @ 2004-07-26  2:25 UTC (permalink / raw)
  To: Zsh Hackers

Clint Adams <schizo@debian.org> typed:
: -    if (!(termflags & TERM_SHORT) && tcstr[cap]) {
: +    if (!isset(SINGLE_LINE_ZLE) && tcstr[cap]) {

s/SINGLE_LINE_ZLE/SINGLELINEZLE/
however I'd be more inclined to use the following conditional
though possibly the check on SINGLELINEZLE might be elided
depending on what commitments upon output we claim on that
option.

Regards,
Geoff

--- Src/prompt.c.org	2004-06-23 04:31:08.000000000 +1000
+++ Src/prompt.c	2004-07-26 12:20:11.000000000 +1000
@@ -746,7 +746,8 @@
 mod_export void
 tsetcap(int cap, int flag)
 {
-    if (!(termflags & TERM_SHORT) && tcstr[cap]) {
+    if (tccan(cap) && !isset(SINGLELINEZLE) &&
+        !(termflags & (TERM_NOUP|TERM_BAD|TERM_UNKNOWN))) {
 	switch(flag) {
 	case -1:
 	    tputs(tcstr[cap], 1, putraw);


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

* Re: Bug#134474: zsh misbehaves if LINES=2
  2004-07-26  2:25       ` Geoff Wing
@ 2004-08-03 15:46         ` Clint Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Clint Adams @ 2004-08-03 15:46 UTC (permalink / raw)
  To: Zsh Hackers

> however I'd be more inclined to use the following conditional
> though possibly the check on SINGLELINEZLE might be elided
> depending on what commitments upon output we claim on that
> option.

Should someone commit this?


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

end of thread, other threads:[~2004-08-03 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E16cYRl-00039Y-00@silk.kitenet.net>
2002-02-18  1:55 ` Bug#134474: zsh misbehaves if LINES=2 Clint Adams
2002-02-21  6:50   ` Bart Schaefer
2004-07-23 18:04     ` Clint Adams
2004-07-26  2:25       ` Geoff Wing
2004-08-03 15:46         ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).