* ZSH
@ 2022-03-03 18:13 César Julio Estrada Pérez
2022-03-03 21:05 ` ZSH Lawrence Velázquez
0 siblings, 1 reply; 4+ messages in thread
From: César Julio Estrada Pérez @ 2022-03-03 18:13 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 82 bytes --]
How to let history ignore the wrong command? How zsh can delete it
automatically?
[-- Attachment #2: Type: text/html, Size: 253 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ZSH
2022-03-03 18:13 ZSH César Julio Estrada Pérez
@ 2022-03-03 21:05 ` Lawrence Velázquez
[not found] ` <CAOiiT9WCYc+HSL03jFLwtBKatBd0nDCatL1_gjiZqbzd4bWMvA@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Velázquez @ 2022-03-03 21:05 UTC (permalink / raw)
To: César Julio Estrada Pérez; +Cc: zsh-users
On Thu, Mar 3, 2022, at 1:13 PM, César Julio Estrada Pérez wrote:
> How to let history ignore the wrong command? How zsh can delete it
> automatically?
What counts as a "wrong command"?
--
vq
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: ZSH
[not found] ` <CAOiiT9WCYc+HSL03jFLwtBKatBd0nDCatL1_gjiZqbzd4bWMvA@mail.gmail.com>
@ 2022-03-07 1:17 ` Lawrence Velázquez
2022-03-07 2:21 ` Bart Schaefer
0 siblings, 1 reply; 4+ messages in thread
From: Lawrence Velázquez @ 2022-03-07 1:17 UTC (permalink / raw)
To: César Julio Estrada Pérez; +Cc: zsh-users
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 this?
>
> For example:
>
> $gut clone / git clone
> $sud apt updat / sudo apt update
You still haven't clarified exactly what you mean by "wrong commands".
--
vq
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: ZSH
2022-03-07 1:17 ` Fwd: ZSH Lawrence Velázquez
@ 2022-03-07 2:21 ` Bart Schaefer
0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2022-03-07 2:21 UTC (permalink / raw)
To: César Julio Estrada Pérez; +Cc: Zsh Users
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).
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-07 2:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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).