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 28830 invoked from network); 26 Mar 2023 14:34:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Mar 2023 14:34:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1679841265; b=UzqVMY3+/1600hL2puNKlEVIVA6NpmzY3I1ztrRUmpEIhw/v1xPXrsdM7AYL6/VKJMHUxNy2MZ x4cFYWpV4CXj4VOuyUzaDSb7zUPz9cLWOraatJWh6IW9SRcC4GMT/FLikH4OY3SFQrvgYR5KMw SHsrJK1u7ZJkgFODQXYpByQDVcUHXzQDsfUspGDZUj2sFIXJoXW+bgO94Q4OEh9UWzOQDUZjaf hOu12bn2SiS4psQrrnGM/mCRAaUtxVgMQjvxmd57KPF+LTyy6IcBVCphdvl90L6f+99aTsAUod iBpc2ApvkwMCc5/OVwTsYNaACmPmxEHTudtz6aS48yQLPw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f175.google.com) smtp.remote-ip=209.85.214.175; dkim=pass header.d=gmail.com header.s=20210112 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=1679841265; bh=yWfC+TfN3PF+R+Ka4UAcOUB/texleAggA3GTMnxMUAk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:Reply-To: MIME-Version:DKIM-Signature:DKIM-Signature; b=hKCfeiDjrNgtI5xz52aEVQq8q86NzDNlfn7GFQjCOC/LyKJVx35IY5lEhzGijqpzVZ3ryKzrpB R0TlMTitOMoldqUvkyN++9GRhnpG+rPKxULDoBmBcxKpEnkVIxPmaR/lfpGKVTNczFzQBONb4Z 4vHyGElZ/iPPkDMvuwoeUGVcN4UDpHewJlAkYjZZf+Z1+UmQRWxK+ZyA+CfV5+Yp6o7+2RE4oL lGLK7w/pIKAM6QYdrnnjMxwGEneJQde7Pje/F6ilViMWu7G88Ot5WKfJSQIPX1YdzvtFvShpOR +YQchRhliETKl73ZuiHzj3cx7ZrmasaJ+VrSuGSskIppBg==; 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:Reply-To:MIME-Version: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=GQH3itS2DToGF57GVnBpH1Lz5bN+wKgo7wxS97zijiQ=; b=n0oEJ2Kl6cnn6Xp8T1zTdQs0M7 NouK+gtS+g9p6CwptUk0vHJXOMTsfFCHdz+6HcQLCfWE++u89sKxyyoQhGMyx+r8vKu3rUYWYLtN8 K2ME33xWBVghp9OLo+gLOrFkl1iwaHq89fBQjex8bQ3tkN40QXpdd62rWY2RjDQzYymFnVkFgL+mm X8GnSKwIGKYdKVCJ3aBss01o3uvJkmCzeRATSGpgjRPU4y2QvfvB3osy/jPYgul6ALsBCx3x0w3iV PpboQN4pDNWM5R4xFbwUV2h+0Sw4453qTIxV9MAMR7HlNN/o6YKZDzUHDqc/jLSMmFqqZ9HvHlZHd ybr1YXuQ==; Received: by zero.zsh.org with local id 1pgRRv-00025I-Sh; Sun, 26 Mar 2023 14:34:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f175.google.com) smtp.remote-ip=209.85.214.175; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f175.google.com ([209.85.214.175]:37879) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pgRRI-0001Nj-47; Sun, 26 Mar 2023 14:33:44 +0000 Received: by mail-pl1-f175.google.com with SMTP id o2so6102985plg.4 for ; Sun, 26 Mar 2023 07:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679841222; h=to:subject:message-id:date:from:reply-to:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=GQH3itS2DToGF57GVnBpH1Lz5bN+wKgo7wxS97zijiQ=; b=Zvlu432L7UYhQlwDJIWwy4QJqSsIICr3B0uPZzDh7iZsZLI2GwFCEelT3Ml04gRc/H ew0zCmCa3qY/K03J6lxbJDSdtZS9T80yEO6WpmKXPucJSSY+UMLtXiNG6fxk19WZoVG3 nA070aDtNrK0muiGI19Wzg7Fb5p3Bgfclj6CH+NCu/4cXJObfUndUqWdYWkoclAhVgf6 KUve8PMjYTlvLx62G8vs5ZULfrgrlm55tzKbtDSu56b0wGD0PNKCY49NI/NA9td7Hf2p StHyXed2CAMuKUmgdiehrPsNqlHAhqFbmZfNsUwomxUqJHFNWg/QrWTS2Gdy1HlXqXo1 FH2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679841222; h=to:subject:message-id:date:from:reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GQH3itS2DToGF57GVnBpH1Lz5bN+wKgo7wxS97zijiQ=; b=ugn9loYWHoMN1puWqYruRBXHddTMvmCWar+2KBrIVhZV08Ul1WqGuyT62C0YMcceuS QGHywgfRnpl/jOIdyaplKxazNhNcipaKjzXwxtQFzQD6dU45sor2Vyl9k8iRkpVEZkGX /GiVEVuEd8S+U2T76YMtGiL1mxHvJ6zGIjI4iXCyvrRrnqV86+D3koNr6A9jlNuWnyFV KgLK3nNFOE0M8Kjq8eoGhVJDLx4P2hxBjCJirOa785o/yKtIZgsC5xdj3E1kaj5EX4c6 ss0K3DP9t6uPMEw4isrthG5BTZZXM6rNqz0S20IXuFY2o1ONg/xafzA5TOl5bKSEWTKO wfhg== X-Gm-Message-State: AAQBX9fCJeK+uwjci0O4dwLzwpa8zrsKKitfTHX3lSed9X4izvE0kQQL L1WA9DSGN/9mBtE2Zpfj1Bbuc0NXW/6GLCl4av6IsqqzpCA= X-Google-Smtp-Source: AKy350Yz/W/jCSSXdrRd28r9pNH68W1WPJri3B0BP43wXX18CTnsh5oedNjGzXYAu4CCJS3C1b5X6kFLJl/jAUneVaU= X-Received: by 2002:a17:90a:1789:b0:230:8d09:962b with SMTP id q9-20020a17090a178900b002308d09962bmr2554858pja.7.1679841222399; Sun, 26 Mar 2023 07:33:42 -0700 (PDT) MIME-Version: 1.0 Reply-To: linuxtechguy@gmail.com From: Jim Date: Sun, 26 Mar 2023 09:33:32 -0500 Message-ID: Subject: strange interaction between read command and pipe to less from function To: zsh Content-Type: multipart/mixed; boundary="0000000000005733b305f7ce835d" X-Seq: 28981 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: --0000000000005733b305f7ce835d Content-Type: multipart/alternative; boundary="0000000000005733b005f7ce835b" --0000000000005733b005f7ce835b Content-Type: text/plain; charset="UTF-8" Hi everyone, I'm at a loss trying to figure out what is going on with a function I am testing. It has the following read statement which is part of a loop: for N ({0..255}) { read -s -t1 -d $'\a' $'c?\e]4;'${N}$';?\a' && XC+=("$N ${c##*;}") } This works just fine in retrieving the hex color codes in both xterm and xfce4-terminal. The issue is when the output of my function is piped to less. The keys do not respond correctly. Where 'space' would normally page the output, or 'q' would quit less, I now have to follow the keystroke(space, q, gg ...) with the 'enter' key to have the action take place. Commenting out the read statement and less acts normally from output I generated to test with or without the read statement. I attached the function file with an added '.txt' extension to name(FYI). Any thoughts on what is happening would be appreciated. The read statement was taken from something I found on one of the 'Stack' sites if I remember correctly. I guess I could be using the read statement incorrectly, but I don't know what it could be. ZSH_PATCHLEVEL: zsh-5.9-0-g73d3173 Thanks in advance, and regards, Jim Murphy --0000000000005733b005f7ce835b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone,

I'm at a lo= ss trying to figure out what is going on with a function I am testing.
It has the following read statement which is part of a loop:

for N ({0..255}) {
=C2=A0 read -s -t1 -d $&#= 39;\a' $'c?\e]4;'${N}$';?\a' && XC+=3D("$N= ${c##*;}")
}

This works just f= ine in retrieving the hex color codes in both xterm and xfce4-terminal.

The issue is when the output of my function is piped = to less.=C2=A0 The keys do not respond
correctly.=C2=A0 Where = 9;space' would normally page the output, or 'q' would quit less= , I now
have to follow the keystroke(space, q, gg ...) with the &= #39;enter' key to have the action take
place.

<= /div>
Commenting out the read statement and less acts normally from out= put I generated
to test with or without the read statement.

I attached the function file with an added '.tx= t' extension to name(FYI).

Any thoughts on wha= t is happening would be appreciated. The read statement was
taken= from something I found on one of the 'Stack' sites if I remember c= orrectly.

I guess I could be using the read statem= ent incorrectly, but I don't know what it
could be.

ZSH_PATCHLEVEL:=C2=A0 zsh-5.9-0-g73d3173
Thanks in advance, and regards,

Jim Mu= rphy

--0000000000005733b005f7ce835b-- --0000000000005733b305f7ce835d Content-Type: text/plain; charset="US-ASCII"; name="cvt_256_colors_2_rgb_hex_fmt.txt" Content-Disposition: attachment; filename="cvt_256_colors_2_rgb_hex_fmt.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lfphp0sv0 ZW11bGF0ZSAtTCB6c2ggLW8gZXh0ZW5kZWRnbG9iCiMgRnVuY3Rpb246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