help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "César Julio Estrada Pérez" <cesarjulioestrada@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Fwd: ZSH
Date: Sun, 6 Mar 2022 18:21:31 -0800	[thread overview]
Message-ID: <CAH+w=7aA+ZVo8uFQ_VMW821DjJ3QRstAYsXaidGEm+Ss8V9ANQ@mail.gmail.com> (raw)
In-Reply-To: <31d441f6-dde7-4d52-8a97-483644cfc73e@www.fastmail.com>

On Sun, Mar 6, 2022, 5:18 PM Lawrence Velázquez <larryv@zsh.org> wrote:
> Looping the mailing list back in.
> On Sun, Mar 6, 2022, at 12:51 AM, César Julio Estrada Pérez wrote:
> > Zsh save the wrong commands in .zsh_history file. How i can fix tis?
> >
> > For example:
> >
> > $gut clone / git clone
> > $sud apt updat / sudo apt update
> You still haven't clarified exactly what you mean by "wrong commands".

In the two cases above, "setopt correct" would give the opportunity to
fix the commands when they are executed, so the corrected versions are
what go into the history.

Commands are added to the history before execution is attempted, so
there's no opportunity to skip "wrong commands" no matter what that
specifically means.  If "setopt correct" won't suffice, the only
option would be to create a zshaddhistory hook that does its own
independent attempt to discover what's "wrong", such as (for example)
searching $path for ${{(z)1}[1]} (assuming the command line is not
"complex" such as a while-loop or if-else).

      reply	other threads:[~2022-03-07  2:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 18:13 ZSH César Julio Estrada Pérez
2022-03-03 21:05 ` ZSH Lawrence Velázquez
     [not found]   ` <CAOiiT9WCYc+HSL03jFLwtBKatBd0nDCatL1_gjiZqbzd4bWMvA@mail.gmail.com>
2022-03-07  1:17     ` Fwd: ZSH Lawrence Velázquez
2022-03-07  2:21       ` Bart Schaefer [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7aA+ZVo8uFQ_VMW821DjJ3QRstAYsXaidGEm+Ss8V9ANQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=cesarjulioestrada@gmail.com \
    --cc=zsh-users@zsh.org \


* 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


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).