zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Zsh Workers <zsh-workers@sunsite.auc.dk>
Subject: Re: BUG: vared in function
Date: Wed, 31 May 2000 17:00:17 -0700	[thread overview]
Message-ID: <000531170017.ZM27165@candle.brasslantern.com> (raw)
In-Reply-To: <E12xGy9-000474-00.2000-05-31-23-28-09@mail1.svr.pol.co.uk>

On May 31, 11:28pm, Peter Stephenson wrote:
> Subject: Re: BUG: vared in function
> Peter Stephenson wrote:
> > Bernd Eggink wrote:
> > > Argh... 
> > > 
> > >    # t
> > >    vared -cp "Aha: " BLAH
> > > 
> > >    % t
> > >    t:vared:2: ZLE not enabled
> > > 
> > > This breaks lots of my scripts! 

This is happening because of my bug report to the effect that vared was
improperly munging the TTY settings in an interactive shell that had ZLE
explicitly turned off (as e.g. inside and emacs shell buffer).

I don't know how that interacts with Peter's patch (I'll try it later when
I get home).

> I'm in two minds on whether to commit this.  On the one hand, there is more
> of a potential for problems with read or vared.  On the other hand, without
> it it introduces a new problem just for one version.

I think there's a bug here:

> +    /* We should have a SHTTY opened by now. */
> +    if (SHTTY == -1) {
> +	/* Unfortunately, we didn't. */
> +	fprintf(stderr, "not interactive and can't open terminal\n");
> +	fflush(stderr);
> +	return 1;
> +    }

That `return 1;' is supposed to be an abort of (what is now) the *caller*
of openttyspecially().  As you have it, that's going to make the caller
think that opening the tty succeeded.  If you're going to pull this stuff
out into a function, you need three return states, not two.


  reply	other threads:[~2000-06-01  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-31 21:06 Bernd Eggink
2000-05-31 21:55 ` Peter Stephenson
2000-05-31 22:28   ` Peter Stephenson
2000-06-01  0:00     ` Bart Schaefer [this message]
2000-06-01  4:55       ` Bart Schaefer
2000-06-01  7:58   ` BUG: vared in script (was: vared in function) Bernd Eggink

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=000531170017.ZM27165@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.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).