From: Geoff Wing <gcw@zsh.org>
To: Zsh Hackers <zsh-workers@sunsite.dk>
Subject: PATCH: Re: Clearing RPS1: Is there a better way to do this?
Date: Tue, 16 Oct 2001 15:26:40 +1000 [thread overview]
Message-ID: <20011016152640.A18535@primenet.com.au> (raw)
In-Reply-To: <1011015171102.ZM8325@candle.brasslantern.com>; from schaefer@brasslantern.com on Mon, Oct 15, 2001 at 05:11:15PM +0000
Bart Schaefer <schaefer@brasslantern.com> typed:
:`setopt TRANSIENT_RPROMPT', perhaps?
No docs yet. Also, RPROMPT won't disappear after positive response to >
LISTMAX type questions. If this works OK for people (especially
those who use ALWAYS_LAST_PROMPT (I don't)), I'll get some docs
together for it.
Regards,
Geoff
Index: options.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/options.c,v
retrieving revision 1.10
diff -u -r1.10 options.c
--- options.c 2001/06/27 11:22:05 1.10
+++ options.c 2001/10/16 05:10:51
@@ -199,6 +199,7 @@
{NULL, "singlecommand", OPT_SPECIAL, SINGLECOMMAND},
{NULL, "singlelinezle", OPT_KSH, SINGLELINEZLE},
{NULL, "sunkeyboardhack", 0, SUNKEYBOARDHACK},
+{NULL, "transientrprompt", 0, TRANSIENTRPROMPT},
{NULL, "unset", OPT_EMULATE|OPT_BSHELL, UNSET},
{NULL, "verbose", 0, VERBOSE},
{NULL, "xtrace", 0, XTRACE},
Index: zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.33
diff -u -r1.33 zsh.h
--- zsh.h 2001/07/06 18:33:59 1.33
+++ zsh.h 2001/10/16 05:10:53
@@ -1439,6 +1439,7 @@
SINGLECOMMAND,
SINGLELINEZLE,
SUNKEYBOARDHACK,
+ TRANSIENTRPROMPT,
UNSET,
VERBOSE,
XTRACE,
Index: Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.20
diff -u -r1.20 zle_main.c
--- Zle/zle_main.c 2001/09/03 01:39:20 1.20
+++ Zle/zle_main.c 2001/10/16 05:10:54
@@ -1057,6 +1057,7 @@
* extra `inlist' check]). */
int sl = showinglist;
showinglist = 0;
+ trashedzle = 1;
zrefresh();
showinglist = sl;
moveto(nlnct, 0);
Index: Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.3
diff -u -r1.3 zle_refresh.c
--- Zle/zle_refresh.c 2001/08/15 15:17:42 1.3
+++ Zle/zle_refresh.c 2001/10/16 05:10:55
@@ -76,6 +76,11 @@
/**/
mod_export int clearlist;
+/* Zle in trashed state - updates may be subtly altered */
+
+/**/
+int trashedzle;
+
#ifdef HAVE_SELECT
/* cost of last update */
/**/
@@ -167,6 +172,7 @@
olnct = nlnct = 0;
if (showinglist > 0)
showinglist = -2;
+ trashedzle = 0;
}
/*
@@ -357,6 +363,20 @@
zputs(lpromptbuf, shout);
if (lpromptwof == winw)
zputs("\n", shout); /* works with both hasam and !hasam */
+ } else {
+ txtchange = pmpt_attr;
+ if (txtchangeisset(TXTNOBOLDFACE))
+ tsetcap(TCALLATTRSOFF, 0);
+ if (txtchangeisset(TXTNOSTANDOUT))
+ tsetcap(TCSTANDOUTEND, 0);
+ if (txtchangeisset(TXTNOUNDERLINE))
+ tsetcap(TCUNDERLINEEND, 0);
+ if (txtchangeisset(TXTBOLDFACE))
+ tsetcap(TCBOLDFACEBEG, 0);
+ if (txtchangeisset(TXTSTANDOUT))
+ tsetcap(TCSTANDOUTBEG, 0);
+ if (txtchangeisset(TXTUNDERLINE))
+ tsetcap(TCUNDERLINEBEG, 0);
}
if (clearflag) {
zputc('\r', shout);
@@ -504,11 +524,14 @@
zfree(nbuf[ln], winw + 2), nbuf[ln] = NULL;
/* determine whether the right-prompt exists and can fit on the screen */
- if (!more_start)
- put_rpmpt = rprompth == 1 && rpromptbuf[0] &&
- !strchr(rpromptbuf, '\t') &&
- (int)strlen(nbuf[0]) + rpromptw < winw - 1;
- else {
+ if (!more_start) {
+ if (trashedzle && opts[TRANSIENTRPROMPT])
+ put_rpmpt = 0;
+ else
+ put_rpmpt = rprompth == 1 && rpromptbuf[0] &&
+ !strchr(rpromptbuf, '\t') &&
+ (int)strlen(nbuf[0]) + rpromptw < winw - 1;
+ } else {
/* insert >.... on first line if there is more text before start of screen */
memset(nbuf[0], ' ', lpromptw);
t0 = winw - lpromptw;
@@ -518,7 +541,7 @@
nbuf[0][winw] = nbuf[0][winw + 1] = '\0';
}
- for (ln = 0; !clearf && (ln < nlnct); ln++) {
+ for (ln = 0; ln < nlnct; ln++) {
/* if we have more lines than last time, clear the newly-used lines */
if (ln >= olnct)
cleareol = 1;
@@ -526,7 +549,7 @@
/* if old line and new line are different,
see if we can insert/delete a line to speed up update */
- if (ln > 0 && ln < olnct - 1 && !(hasam && vcs == winw) &&
+ if (!clearf && ln > 0 && ln < olnct - 1 && !(hasam && vcs == winw) &&
nbuf[ln] && obuf[ln] &&
strncmp(nbuf[ln], obuf[ln], 16)) {
if (tccan(TCDELLINE) && obuf[ln + 1] && obuf[ln + 1][0] &&
@@ -558,6 +581,7 @@
/* output the right-prompt if appropriate */
if (put_rpmpt && !ln && !oput_rpmpt) {
+ oput_rpmpt = put_rpmpt;
moveto(0, winw - 1 - rpromptw);
zputs(rpromptbuf, shout);
vcs = winw - 1;
@@ -616,7 +640,6 @@
/* store current values so we can use them next time */
ovln = nvln;
olnct = nlnct;
- oput_rpmpt = put_rpmpt;
onumscrolls = numscrolls;
if (nlnct > vmaxln)
vmaxln = nlnct;
next prev parent reply other threads:[~2001-10-16 5:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-14 18:11 Bart Schaefer
2001-10-15 4:53 ` Geoff Wing
2001-10-15 17:11 ` Bart Schaefer
2001-10-16 5:26 ` Geoff Wing [this message]
2001-10-16 15:16 ` PATCH: " 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=20011016152640.A18535@primenet.com.au \
--to=gcw@zsh.org \
--cc=zsh-workers@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).