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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5610 invoked from network); 23 Aug 2023 14:41:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Aug 2023 14:41:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1692801706; b=Q2TmEglNgu7t5/k3vJJXZTWjE4f+454unk0cqUB9nVzDKMS6YUY9283BXxT7AM2/j43g0r46zk LMlhBe3YudyongSalyIVaJe78C64dwKY0lnOr5tHnb96JTZ/hfX6ywpzox2MrpMpBBjz1uH/Od 89ToVDnFk8R3nRc9XkMxyaYx3ZYAShkd5YDiZMAs7kLsKs/FN/yWdhjMzASWBglNO9YPX2iPFM GxYNaqbTJs5ANDKKr2RpQ/tMnA9jtHOThex+Tl9NUSQawwl007ZwlZAe+GCr6KmYqI1ZSXNZPH 8L4CCc+54RJqfYyCyK5NZl5A1mKvG4IIFmYDpzGfI94DTQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1692801706; bh=kRbJzHDQQsfeMEWLv7DYghlKb5inGw4PzCaq/r/oXSo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=CiGh6Ub1rIm99hyBrkRWu6naPXzEef9sGQpFsCn6zI+5yUlc3Bl9SonUi9zs0glojB7Khuy5wG 4R/MIFWDhyuRGsCBoqkeEMMEBJ0rdlGgJh/iXB1aH21C8swTbnN09/K2GM/3DvsaEMPN0lawkV UnyJ/071Q96gsKQIWpMlHK7ViPHL8zwUspQOwEA+r0tETYuOZ94FIwlFMjdkm2hvrgrqEU6TuL xeJOxd33MSJkJybYCpGAM3AtuxKp0f3Wvg7QCSS9MzFBXzmt7xfwHX8o+joeX2asqAFY4yALCN KOsZKqOP8GG/OgJQL4uC9SXZfBbFIxAgoHnZtX4STRHb3A==; 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-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=egEK1jc0ZxZf9slEdr2Nrfv4gHlepv/nJjKC/vLSp1E=; b=NtX1mSRoqYSs3DWIzMfv6GKDy3 umcaRXwBlxK5DjtSgE3Rr1ALz84UbH5sYuCGXIJbdiZU8LsrJCvAmqF6TktuetkulPNXSBVPFmbMz Dz891ntH7FSGUB44hITk6/nVeVueu32ELLiihE8eqbUvtJK+LFoVAYPq8/MXSuZoRa1h8SH81tZYR xy6svEPaPup7LPyHTFK5zFKpVp92LOzh1a8aB1KaZgsRdZ3FQLd3AaGhy/4giGZhW1wVaqEF4MYSS bs68NHsPqAeajw0CSixnSkwuhlJg1iTDtN9TYbtwhHAMmZUlTY96qRgsQrYP/ikwBnbzIu/9ro7PF eZjqkppg==; Received: by zero.zsh.org with local id 1qYp3K-00070W-0K; Wed, 23 Aug 2023 14:41:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f170.google.com) smtp.remote-ip=209.85.219.170; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f170.google.com ([209.85.219.170]:60568) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qYp2j-0006It-Ku; Wed, 23 Aug 2023 14:41:10 +0000 Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-d72cf9156easo5180965276.0 for ; Wed, 23 Aug 2023 07:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692801668; x=1693406468; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=egEK1jc0ZxZf9slEdr2Nrfv4gHlepv/nJjKC/vLSp1E=; b=rTWKb7p0x/X23waKxY/AKkGa+2XDy0ATIZgKMAniW7AVOUDUJXewLq/UyzLTVoOJfc vXhahbBLeHvnhLAxRFsvfxjyroZ6DWse+/FiILtqn8dVl0VhRqRIvkE/GEb3QBxDmk8b KIXpTDxDIeVrQUvW2iQ9pXbNSlFejhLw/PCb1t16w8iIDIoYZp3fcigdl4M/bTxx17V9 WFG1o480U49JXS3BoHToDdYvUNbvTXkYT7bTRHxz/UVjZ2OAvir1LSz9iumrpl7UheBC tr+lqAFcbyJSwQ98Mm80JWiV/eXWndhO1VwtYSRpaPhouN3Pxhbkf66fan7wOuYp+Y01 xsYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692801668; x=1693406468; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=egEK1jc0ZxZf9slEdr2Nrfv4gHlepv/nJjKC/vLSp1E=; b=V+25AL4tvcRkpNzVeD5pKabsfqq1rh/d5ayl4BNfwMmFOnwx4OYdSJqYuoWVFqFXOi RoIXgPIyxfYoNMLu9N4yxLFV25b0HEqulzpWyKLRHK+m0mxPxrfAEcCjoIsdYPtxudYS aoMsB4yHm+6TzQ544Py6Z6GfkM37G1RrVzxMle4ZI2gUya7pUdt0JTV6LjQyHndn1Bvk H0qu38JgPcsQUnHwo7gw8w2fxhMaQ75lWAYs83ukizFc5lNeFOfXyR+CidF8o9JC5bb3 uZHmT4FBAhUe9YNKCGoUzox8reCCDgdO8ghYWVt9Xz12Jb61E+KNLJOgkOAgK628RPRo ct8g== X-Gm-Message-State: AOJu0YyZO+9VF1SiWX+YD0RHAkagndexeVztaSZit0oUKZE3np2vJHzJ ndhe+j0Z5pt6LNbj4CHGBU8LQR+gnuxeILekCrZWNTHF X-Google-Smtp-Source: AGHT+IEMttzXQJD882k/zojnbOVu7/eZlvhFZOfkqTC2qhAkNuwtAw2nBdU7v//yWXp7iqZNmkEkaciO1xOOMSD4tMM= X-Received: by 2002:a25:d149:0:b0:d55:370b:aa2e with SMTP id i70-20020a25d149000000b00d55370baa2emr14280674ybg.25.1692801667971; Wed, 23 Aug 2023 07:41:07 -0700 (PDT) MIME-Version: 1.0 From: Pier Paolo Grassi Date: Wed, 23 Aug 2023 16:40:30 +0200 Message-ID: Subject: widget accept-no-history To: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000183fc30603981ae3" X-Seq: 29190 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: --000000000000183fc30603981ae3 Content-Type: text/plain; charset="UTF-8" Years ago I created a widget that allows me to accept a line without committing it to the history: execute_no_history(){ fc -p /dev/null ________tmp___restore_history=1 zle accept-line } and my precmd contains: precmd(){ [[ $________tmp___restore_history -eq 1 ]] && { unset ________tmp___restore_history fc -P } } now I noticed that when I execute it as a non-privileged user, I get: precmd:3: locking failed for /dev/null: permission denied So I wonder, what would be a better implementation? Pier Paolo Grassi --000000000000183fc30603981ae3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Years ago I created a widget that allows me to accept= a line without committing=C2=A0it to the history:

execute_no_history(){
fc -p /dev/null
________tmp___restore_histor= y=3D1

zle accept-line
}

and my prec= md contains:

precmd(){
[[ $________tmp___resto= re_history -eq 1 ]] && {
unset ________tmp___restore_history fc -P
}
}

now I noticed that= when I execute it as a non-privileged user, I get:

precmd:3: locking failed for /dev/null: permission denied
<= br>
So I wonder, what would be a better implementation?

Pier Paolo Grassi
--000000000000183fc30603981ae3--