From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30378 invoked from network); 7 Mar 2022 02:22:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Mar 2022 02:22:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1646619742; b=ThYqQWhy7kIDwq1R2K4dffTYcY/d9CnadWqaRCgROee+ujLoUJpYFmFZHKRvc4oq6cIXrkBAVg X1ss53K70Rs3sN5sPra1SfR4j2/GwLh276jd9FPi3IMWMFSRMER1xq4388wVylWf+1nZdXhf7T EipgSgF5TpIzg+2txlfUEoDMu9OeonvET47S3tQZX+hoy/R34TrCYS+v2nVRVTIT1xoVqcmaLK dv4rFbpFSaa8o+6j7+PB0IudMHmwOx4EwxaDNykXFQLj4w+CwkzNNM0mhJ4kvp34HfWblP6EZr xf6fbwfFik5nsks4o7VBjASnDyysd+XUVuQTm8aAS7NtNw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yw1-f170.google.com) smtp.remote-ip=209.85.128.170; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1646619742; bh=HU4JpZszzq/9fx7G7ROTUVudNTdmn9sOV/wHUevWFiM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Kr1wVoYxTbc7TCpwvKWX0mDZMVVP7yqSnbFxyZhpb4Gv282FmgCac7BWqoo8kgbz8nKV4TbGDm wlGWTlHCetZmWog2GNwjAz66CJaGOo7HItsmSmA5kYqXJbsHXfWIvnryi4oiNjyP96h9OSyKCn 8HXCM+5oGQvmxyTFEG18j214rl2vAED/hmE5+RHPrCYIb4emRCPT+6P/N+uj/XIYKhUiIohJzB HmcsCa+K9J+wVbgW9E1PzGgqV/Y4dCkTy6Hav5XSZuv0MWQ3m/52Lbg9y9B+8mb3GkCv3i8Zlt 0cBZxcHjYgvLfsf33+guYIyke9mhW3kzIxuetQeqI/RLlA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=VgUhNGod97lv0ux8heifREz5dTnkOnuI6BpXAwFB0fA=; b=sxOgBsLihEStRKTSJXDTFx1DvN JTXK19U/2kOxqhlwT/7TR3pYdfPXX/BMPQWOHjeng7sUqUCrHXuuYiKfX/MlphCl5knn0/GFw9tTK C048EvXVqj/g8CNOHs2h/7PZWGtX9iKTRnS/5gVatXq/0q0HJsf26odrJfLP1LRdLjxQJzFaEQgur 42T+ucSLDGVFJCCkeZ3MESdPffS+FeEgbSGnStsogv7T7Jie+ZJz6swe7STBuKVG/b7sDmWeo2K2N IMYyBm5QJOijSdR9ejoXcxagVUPXZtgAEyLuILjHEstPQnXwH2qVl7VE4msgTYJuBhnVaJRNC0ZEw KW8pilRg==; Received: from authenticated user by zero.zsh.org with local id 1nR30u-000DfP-WB; Mon, 07 Mar 2022 02:22:21 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yw1-f170.google.com) smtp.remote-ip=209.85.128.170; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yw1-f170.google.com ([209.85.128.170]:41644) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nR30J-000Cw1-74; Mon, 07 Mar 2022 02:21:44 +0000 Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-2dc242a79beso137750537b3.8 for ; Sun, 06 Mar 2022 18:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VgUhNGod97lv0ux8heifREz5dTnkOnuI6BpXAwFB0fA=; b=FQrFgzWMu8++68RBncXyQy3cEduYigyFwSdCpA+M4AE1jsRfXaWZ9yu15BfhB5Yb4X Mi8dxVvWo60MpD1FKZSq4UW3vpueO0QE/PgRHct3hVoT6zxDTpWQfOORr/ae8lds4Vpq QFLgxIX3RQG3PZrI9Xtu/fbNfF7jh+SYe562NbjRVj5zsxgePtq0fSegPIhjLB3/OFOX Sf9hDIqYHtY3Wp283+9AmUEdoUFTpCmkr+hPrM/3aeUpjchVse87gGdbkapbpL0upkzm htC/ReVTJUg4UHcIChr6+7J0zJv17zKwBIus92SZSDc+3xwn56Qu+14xpbgnnoLEPYWM fn1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VgUhNGod97lv0ux8heifREz5dTnkOnuI6BpXAwFB0fA=; b=cHgZKYGl76Zv66NQKXea54VaPJ5cIgvktxDvyR2DqI2cnUaD8Qh5rTI9R9uPQRRtZ5 NxUvtMARGLAsiOESHJGru0D/FSKgcJFoI7II2wzPifBXN35QIG4HeyMQHJ6u/DZJ9ruX xaIMoOBQIfmOohZsiTThcytt9zIPkaMPxztLRCRREI8FI49WO+4VrS+sYT3xTlN0vqzb 8fJGC0fmI4X9pZA7ETNj3cLUpHs8btXJJro/yDuQJ5jGor9+snsylzpRMB9tMo9MF+o/ /ZApSom2JEjxWLdVoF/U9bMkgYbGXV/WDAdw2d9N5pU8p2dTsX9oVk/dvSlyKWaQCzQW 4UpA== X-Gm-Message-State: AOAM5313WGeHOGCX0p7IWovte90XLN3p7jPAVP2CBYST4McnXrh8/5wR nDOd7O/mg7YDqU4t7Qxc50XDgrses4dzKK1ddIyEmg== X-Google-Smtp-Source: ABdhPJxrLNzeV3HOTYRwsrPkze3g4mnKy5U4hjBT9p1YtBtOhZsQeVd/NYGxaLqaWQMz+4CEH7uwZ0Kb2I8hg7awPbA= X-Received: by 2002:a81:3a13:0:b0:2dc:50bc:c975 with SMTP id h19-20020a813a13000000b002dc50bcc975mr6909981ywa.173.1646619701912; Sun, 06 Mar 2022 18:21:41 -0800 (PST) MIME-Version: 1.0 References: <31d441f6-dde7-4d52-8a97-483644cfc73e@www.fastmail.com> In-Reply-To: <31d441f6-dde7-4d52-8a97-483644cfc73e@www.fastmail.com> From: Bart Schaefer Date: Sun, 6 Mar 2022 18:21:31 -0800 Message-ID: Subject: Re: Fwd: ZSH To: =?UTF-8?Q?C=C3=A9sar_Julio_Estrada_P=C3=A9rez?= Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 27542 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sun, Mar 6, 2022, 5:18 PM Lawrence Vel=C3=A1zquez wrote= : > > Looping the mailing list back in. > > On Sun, Mar 6, 2022, at 12:51 AM, C=C3=A9sar Julio Estrada P=C3=A9rez wro= te: > > 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).