From: P.Stephenson@swansea.ac.uk
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: When does single_line_zle get set?
Date: Mon, 26 Jun 95 11:19:18 +0100 [thread overview]
Message-ID: <25744.9506261019@pyro.swan.ac.uk> (raw)
In-Reply-To: "dnelson@xnet.com"'s message of "Sun, 25 Jun 95 21:46:07 CDT." <199506260246.VAA18308@cyclone.xnet.com>
dnelson@xnet.com wrote:
> I just compiled zsh-2.6beta9 (was using 2.6beta-3), and now, on initial
> login shells, single_line_zle mode gets set on me. I login to an ISP via
> modem, and my terminal defaults to 'unknown'. It seems that zsh notices
> this and sets single_line_zle (-M) on me.
Looks like the problem is that there is a termcap entry for unknown,
but it can't go up. The following patch introduces a new state for
the termok flag: it becomes -1 if there is a termcap entry but the
terminal doesn't have up-line capability. The shell then functions in
single line mode until a better terminal comes along, so in practice
this does what the manual page says.
*** Src/params.c.slz Mon Jun 26 11:02:48 1995
--- Src/params.c Mon Jun 26 11:05:39 1995
***************
*** 1662,1672 ****
}
}
! /* if there's no termcap entry for cursor up, use single line mode. */
if (!tccan(TCUP)) {
tcstr[TCUP] = NULL;
! opts[SINGLELINEZLE] = OPT_SET;
}
hasam = tgetflag("am");
/* if there's no termcap entry for cursor left, use \b. */
--- 1662,1675 ----
}
}
! /*
! * If there's no termcap entry for cursor up, use single line mode.
! * termok is set to -1 to flag this.
! */
if (!tccan(TCUP)) {
tcstr[TCUP] = NULL;
! termok = -1;
}
hasam = tgetflag("am");
/* if there's no termcap entry for cursor left, use \b. */
*** Src/zle_misc.c.slz Mon Jun 26 11:02:48 1995
--- Src/zle_misc.c Mon Jun 26 11:05:37 1995
***************
*** 678,684 ****
void
tsetcap(int cap, int flag)
{
! if (termok && !isset(SINGLELINEZLE) && tcstr[cap]) {
if (flag == 0)
tputs(tcstr[cap], 1, putshout);
else {
--- 678,684 ----
void
tsetcap(int cap, int flag)
{
! if (termok == 1 && !isset(SINGLELINEZLE) && tcstr[cap]) {
if (flag == 0)
tputs(tcstr[cap], 1, putshout);
else {
*** Src/zle_refresh.c.slz Mon Jun 26 11:02:48 1995
--- Src/zle_refresh.c Mon Jun 26 11:05:36 1995
***************
*** 66,72 ****
static int lwinw = -1, lwinh = -1; /* last window width & height */
winw = (columns < 1) ? (columns = 80) : columns; /* terminal width */
! if (isset(SINGLELINEZLE) || !termok)
winh = 1;
else
winh = (lines < 2) ? 24 : lines;
--- 66,72 ----
static int lwinw = -1, lwinh = -1; /* last window width & height */
winw = (columns < 1) ? (columns = 80) : columns; /* terminal width */
! if (isset(SINGLELINEZLE) || termok != 1)
winh = 1;
else
winh = (lines < 2) ? 24 : lines;
***************
*** 191,197 ****
cleareol = 1; /* set */
if (t0 > -1)
olnct = t0;
! if (isset(SINGLELINEZLE) || !termok)
vcs = 0;
else if (pptlen && !clearflag) {
fwrite(pptbuf, pptlen, 1, shout);
--- 191,197 ----
cleareol = 1; /* set */
if (t0 > -1)
olnct = t0;
! if (isset(SINGLELINEZLE) || termok != 1)
vcs = 0;
else if (pptlen && !clearflag) {
fwrite(pptbuf, pptlen, 1, shout);
***************
*** 205,211 ****
/* now winw equals columns; now all width comparisons can be made to winw */
! if (isset(SINGLELINEZLE) || !termok) {
singlerefresh();
return;
}
--- 205,211 ----
/* now winw equals columns; now all width comparisons can be made to winw */
! if (isset(SINGLELINEZLE) || termok != 1) {
singlerefresh();
return;
}
--
Peter Stephenson <P.Stephenson@swansea.ac.uk> Tel: +44 1792 205678 extn. 4461
WWW: http://python.swan.ac.uk/~pypeters/ Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.
next parent reply other threads:[~1995-06-26 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199506260246.VAA18308@cyclone.xnet.com>
1995-06-26 10:19 ` P.Stephenson [this message]
1995-11-17 16:38 ` Peter Stephenson
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=25744.9506261019@pyro.swan.ac.uk \
--to=p.stephenson@swansea.ac.uk \
--cc=zsh-workers@math.gatech.edu \
/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).