Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version:content-type;
        bh=3tlblZ42j/NWdh+US8e/yITOwJfdxXsr95bu7CRSfhg=;
        b=YkWBABc6mzTnxxHo2QjrOdUSkW0SyrT6eOPV8zVMuXNQfs57GfZ83/jqz279jzPwVW
         2BPcJ2axhh+fnmozmqrUkbu9XzhMVX5a8e6S0uj9scQWRTJ3mqCkoLHQB9oqSvURNdUy
         sUuUsycTaOUSQSC9EIzJ4vo+RYcS8kJYtFK3nb6nSqitF5ECxQN9bmfVwjPPD6ZB3xU5
         8doPvUSpILYdE/BbNxWBcQR1X9QwSKAqsYPOohn9HX0KLIndQTA0zStKS7yk2FjX/JKd
         tCTxXw6F0vPysQ8bRHB8R6ccpt2szjZpmOYGwjPzZpvEQIhFMemz/kW6RBmhEhl3tODh
         OAUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version:content-type;
        bh=3tlblZ42j/NWdh+US8e/yITOwJfdxXsr95bu7CRSfhg=;
        b=WMfvmgq5wFY7NxnhSoUondVB9/X2BQ0HQwCN/Ni2ZZCG4MdWgQe9xGDWoFjRM2h8GI
         YIJkXm5Zoy8NWIyULC10YgxRUKaP35JgG0MfOUzko6UVPfXtBTknGgIvazonT4SAJrJb
         gv/0uM1yGzHciwkFr+dLY4mff1tqHxkjLiQSMU+X+YDSHJRTuSaY5hCR9j7QGJXoPSGu
         zdWX1mgHTClfj0JW16bM9z0PKQMGLgySgSbJ8R0jQMI5ReJ4a7bB1+k/O4sQkiJmd/Y8
         agkzKJnFHKaYWl88d+BiplQVJA2v4/zOnjBEzHsdHVDeeftOuMtiZ6tyI4h+W/0Ileu8
         K8jA==
X-Gm-Message-State: AG10YOTxuqNAH4VpMuKwAR5Q5XkixUNvv1bERqInrMLsaGUVpPJttWsRCz+S2DNMCX5wJQ==
X-Received: by 10.66.118.198 with SMTP id ko6mr2373269pab.122.1453965920121;
        Wed, 27 Jan 2016 23:25:20 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160127232605.ZM17701@torch.brasslantern.com>
Date: Wed, 27 Jan 2016 23:26:05 -0800
In-Reply-To: <CAHYJk3Q5BP01QvXi1qE1yME7irNOoqXa8BhxXZb+HpDXRUyggA@mail.gmail.com>
Comments: In reply to Mikael Magnusson <mikachu@gmail.com>
        "Re: Aborted command saved in history" (Jan 28,  7:56am)
References: <CAHYJk3TY-JsahHgYWJSe_knx0Xo6D9ecXiTJQ=w+aUTDGHOT8A@mail.gmail.com> 
	<160127214510.ZM2878@torch.brasslantern.com> 
	<CAHYJk3Q5BP01QvXi1qE1yME7irNOoqXa8BhxXZb+HpDXRUyggA@mail.gmail.com>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Aborted command saved in history
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37823

On Jan 28,  7:56am, Mikael Magnusson wrote:
}
} Is it expected that the line is saved [on keyboard interrupt]
} at all though? If you do a get-line and then ctrl-c twice, it is not
} saved, so a possible argument that "you accepted the first part of the
} line when you pressed enter" seems a bit weak to me.

The decision is made based on whether the parser returned anything.  In
the PS2 prompt case, the parser was invoked upon the first accept-line,
whereas in the get-line case the parser was never invoked at all.

This is how it has always worked (and I believe also how history is
handled in csh, whence this is all derived) but I'm not averse to
someone investigating how to change it.  I just don't plan to do so
myself.

Incidentally ZLE_LINE_ABORTED only gets the part that hasn't already
been through the parser, e.g. from the PS2 prompt in the first example.
If we remove the "prebuffer" from the history, we should put it into
ZLE_LINE_ABORTED instead.  Although I suspect that might confuse some
uses of ZLE_LINE_ABORTED.

} Usually when I get a continuation prompt it's because I mistyped
} something, so I press ctrl-c to get out of the continuation and then
} retrieve it with uparrow and try again.

Incidentally this is exactly what push-line-or-edit is for, and is
very nearly what it does.

