zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Peter Stephenson <pws@ibmth.df.unipi.it>,
	zsh-workers@math.gatech.edu (Zsh hackers list)
Cc: Torsten Hilbrich <Torsten.Hilbrich@gmx.net>
Subject: Re: Bugreport zsh 3.1.2: Shell exits prematurely after aborting history-incremental-search-backward
Date: Tue, 2 Jun 1998 10:41:16 -0700	[thread overview]
Message-ID: <980602104116.ZM3619@candle.brasslantern.com> (raw)
In-Reply-To: <9806021550.AA30252@ibmth.df.unipi.it>

On Jun 2,  5:49pm, Peter Stephenson wrote:
} Subject: Re: Bugreport zsh 3.1.2: Shell exits prematurely after aborting h
}
} > If I startup the zsh I immediatly history-incremental-search-backward
} > (^R) in the history.  Instead of executing the found command I simply
} > abort using ^C.  Then the next return with or without any command
} > given will immediatly exit the shell.  It also happens if there is no
} > match found in the backward search.
} 
} It turns out to be in the input code, which is a part of the shell
} last seriously modified by me.  However, there is a flag 'lastc'
} containing the last character read which I didn't touch.  For some
} reason I haven't quite traced, inputline() fails and sets lastc to
} space just in this one case; inerrflush() is called to flush the
} input, and since there isn't any this sets lexstop; this is propagated
} back to the lexerr when isearch exits, which thinks it marks the end
} of input, so the shell exits.

I don't follow how the value of lastc is related to what you describe.
The only way it could possibly matter is if lastc == '\n'; space is the
same as anything else, and the only reason it's set to space is to be
something that won't compare equal to '\n'.  And at the point where all
this is happening, it won't be '\n' to begin with.

In short, I don't believe that your patch has anything to do with the
bug. :-)  The -real- problem is:

} For some reason I haven't quite traced, inputline() fails

The reason inputline() fails is because he's interrupting it with ^C
rather than ^G.  That's causing getkey() to return EOF, which doesn't
immediately have an effect, because once getkeycmd() returns NULL to
break out of doisearch(), it eventually returns to zleread() which
simply goes around the `while (!done && !errflag)' loop again.  When
return is pressed, zleread() finally finishes, at which point it
returns up to gettok() with lexstop == 1, and because errflag is not
set, this is interpreted as ENDINPUT and the shell exits.

Now, having figured all that out, I have absolutely no idea what to
do about it. :-)  However, I suggest NOT applying Peter's patch.

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


  reply	other threads:[~1998-06-02 17:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-01 19:57 Torsten Hilbrich
1998-06-02 15:49 ` Peter Stephenson
1998-06-02 17:41   ` Bart Schaefer [this message]
1998-06-03  9:09     ` Peter Stephenson
1998-06-11 15:26 ` Peter Stephenson
1998-06-12  2:58   ` Bart Schaefer
1998-06-12  9:16     ` Peter Stephenson
1998-06-12 15:38       ` Bart Schaefer
1998-06-12 21:41   ` Torsten Hilbrich

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=980602104116.ZM3619@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=Torsten.Hilbrich@gmx.net \
    --cc=pws@ibmth.df.unipi.it \
    --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).