zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Vincent Lefevre <vincent@vinc17.org>, zsh-users@sunsite.dk
Subject: Re: get the number of active jobs to show in the prompt?
Date: Wed, 3 Oct 2001 14:46:40 -0700	[thread overview]
Message-ID: <011003144640.ZM29828@candle.brasslantern.com> (raw)
In-Reply-To: <4ac3d14900vincent@vinc17.org>

On Oct 3, 10:08pm, Vincent Lefevre wrote:
> > It's not the widget that's doing it.  It's the ZLE internal screen refresh
> 
> OK, so there could be another flag to tell whether to print "\n" or "\r".

Once again, it's not that simple.  It's not just printing a "\n" -- it's
moving the cursor to below the current editing area, which could be many
lines high.

And printing an '\r' instead might still put the new prompt in the middle
of said multi-line area.

At this point Geoff Wing is the right person to continue this discussion
if it's going to be continued, as he's the most recent primary author of
the ZLE screen refresh routines.

Meanwhile, since you know your own prompt doesn't change size, you could
try fooling with something like this:

    zmodload -i zsh/termcap
    function redraw-prompt {
	zle .clear-screen
	if (( BUFFERLINES < LINES - 1 ))
	then
	    precmd
	    echotc sc
	    echotc ho
	    print -nP "$PS1"
	    echotc rc
	fi
	return 0
    }
    zle -N clear-screen redraw-prompt

That'll only work for terminals that have sc/rc (save/restore cursor), and
your PS1 better not have %E in it.


  reply	other threads:[~2001-10-03 21:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-01  5:56 Drew Perttula
2001-10-01  6:09 ` Goran Koruga
2001-10-01  6:12 ` Sweth Chandramouli
2001-10-01  6:37   ` Phil Pennock
2001-10-01  6:59     ` Drew Perttula
2001-10-01  7:08     ` Sweth Chandramouli
2001-10-01  8:28 ` Deborah Ariel Pickett
2001-10-01  9:04   ` Phil Pennock
2001-10-01 17:44     ` Vincent Lefevre
2001-10-02 15:43       ` Bart Schaefer
2001-10-02 16:13         ` Vincent Lefevre
2001-10-02 23:25           ` Deborah Ariel Pickett
2001-10-02 23:29             ` unsubscribe me Matthew Lyon
2001-10-03  0:06             ` get the number of active jobs to show in the prompt? Vincent Lefevre
2001-10-03  5:43               ` Bart Schaefer
2001-10-03 14:22                 ` Vincent Lefevre
2001-10-03 14:59                   ` Vincent Lefevre
2001-10-03 15:11                   ` Bart Schaefer
2001-10-03 15:35                     ` Vincent Lefevre
2001-10-03 15:58                       ` Bart Schaefer
2001-10-03 16:47                         ` Vincent Lefevre
2001-10-03 17:09                           ` Bart Schaefer
2001-10-03 19:34                             ` Vincent Lefevre
2001-10-03 20:01                               ` Bart Schaefer
2001-10-03 20:08                                 ` Vincent Lefevre
2001-10-03 21:46                                   ` Bart Schaefer [this message]
2001-10-03 21:51                                     ` Bart Schaefer
2001-10-03 23:15                                       ` Vincent Lefevre
2001-10-04  0:05                                         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=011003144640.ZM29828@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=vincent@vinc17.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).