From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29795 invoked by alias); 27 Mar 2010 04:24:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 14975 Received: (qmail 20834 invoked from network); 27 Mar 2010 04:24:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100326212348.ZM29516@torch.brasslantern.com> Date: Fri, 26 Mar 2010 21:23:48 -0700 In-reply-to: <20100326202349.GA17385@fermat.math.technion.ac.il> Comments: In reply to "Nadav Har'El" "Re: Append cancelled commands to history" (Mar 26, 11:23pm) References: <20080919162045.GA22435@ruderich.org> <20090706151644.6BF508027106@bifrost.dotsrc.org> <20090706154309.GA15663@fermat.math.technion.ac.il> <20090706155337.GB15663@fermat.math.technion.ac.il> <20100315164237.GA23224@fermat.math.technion.ac.il> <100320105027.ZM20067@torch.brasslantern.com> <20100322084226.GA26739@fermat.math.technion.ac.il> <100322080712.ZM21793@torch.brasslantern.com> <20100324102732.GA23038@fermat.math.technion.ac.il> <100324091951.ZM25340@torch.brasslantern.com> <20100326202349.GA17385@fermat.math.technion.ac.il> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Append cancelled commands to history MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Mar 26, 11:23pm, Nadav Har'El wrote: } } What I still find a bit odd is the fact that this behavior (of saving } the partially entered command in a special place outside the history) } is only applied to whole lines of multiline commands, and not to } interrupted single line commands Once again, it depends on whether you interrupt an instance of the line editor. Every time you hit "enter", you've completed one instance of the line editor and started a new one. You're not interrupting a syntactic construct, you're interrupting an editor instance. If you were to write the entire multi-line construct in a single editor instance, by using ESC-Enter to input literal newlines without starting a new PS2 prompt, then the interrupt would discard the entire multi- line command just as it discards a single-line command. } 2. Why is that special (out of history) memory location for one last } command is needed, or even desired. It's derived from the way that history references work in csh. Even if you set HISTSIZE=0 so that no history is ever saved, references to the immediately preceding command with the "!!" syntax are required to work. Hence that preceding command is always kept around, and there's no good reason not to allow you to scroll back to it with the line editor. As I mentioned before, it's also related to the options that allow you to automatically exclude things from the history file (especially the HIST_NO_STORE and HIST_IGNORE_SPACE options). The most frequent reason to want to retrieve a line from the history is because you made a typo. If you make a typo on a line you otherwise intend to exclude from the history, wouldn't you find it annoying to have to re-type the whole line?