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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14046 invoked from network); 10 Nov 2022 00:53:25 -0000 Received: from zero.zsh.org (94.142.241.90) by inbox.vuxu.org with ESMTPUTF8; 10 Nov 2022 00:53:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668041605; b=sHyO6vjsm8BOKQOyemhW8MzZ4Yr/DnWzap8LlYVmrq7uk+VL6uJF6Qf3KMQ0QCBhQvVQSXVbSI VuL3AGSuRnxMJz/S6T6KHDQqzYLtCBtRxPBF7tafmmB2T2KLrkNY5Ff6zfjfNj1cCJAA6Ua7fg XemSGvS1RCa9I2Gn4FZJPvMq4zpmXziZmQ8xdBJuHGtZbRifSCGYJ48JnHz3rT138JkYash5YT /66gGaPpciZcgbcLjXUwVlWHCTd180pQbWM6s7aicrmj4y8XJovVlGwouYgkBeA1m5HjRNgrkJ VEafJt//Bx9gyxQ/uQugneiBFLZLQZS8MCUqcYuj9pb4JA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668041605; bh=XI573U+7W6tM8dhJ+g7wCxePfyJI2kYFfb4Po1mJr0Q=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:DKIM-Signature; b=CnXd0PHlrLNDpuLubNEq6MGbg5X3xEVJ+yHlTWIRwgh9knwGmwCmHTtaLTpgbxqxREXUhEa2lX ZAvnABo+sBKLqDxMVMrUCMXYavxl6Gf5tcZ4axcE5H7wwvldNWdBNsR4CCYqi3itWCyt21NHXG jGlDOJUzfkydw2VKcHnoJ+5+lc0VZU6P6Vsryc7tBCLERagTUXH9mSRDQpkMt7dU2YinP8tMf6 H7aa6fAljfEmuQ8OUxCp7f7e89KARJz7DBa2eCTbOySxXBySIpmhp5o2slTzXjPICIQlEmHSSP ZWl4ylquDAHESKjxjWO7YM1QGs5GqiboK4TyL9Hc/xdYQA==; 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:Subject:From:To:MIME-version:Date:Message-id:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=Mz4OyMIBZzN3uozWojG0YTxQ8mHsxnnPYNkiKTHq4vE=; b=qNtlOTt5J71Gbn1pvSIFFZu5mT wqW697u08kCAHxAm++9Dbfk+kTqLN8Zn9dYE+tWBtjkw/S3EN+upNhIeCmguaM99b/B9j9cUQ7a6S 8+u8JO0PX8ipyFs23VqIhj3yHlQwaHALh3C+UexZx4SHhnhC6k/Qr+gbwmInn5dpTa3SMVrbL8kMv WH7OBTOzyeDgIWSwpKxENOL8Y0tpMaMqocofY/NZVvQWjhZTtU8tk5YUwXT7Urd+pYFAfd1aCbSJB QRHbhd0f4RqkC7BPuK8tR4H+v+wAY+deXahWQO6cLuvDuL4+59QpQnd0STxKwFsXvFmUQKS24Kdnq eyrVDlTQ==; Received: by zero.zsh.org with local id 1osvk0-000IHJ-MW; Thu, 10 Nov 2022 00:48:24 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:43802) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1osvet-000HTQ-VL; Thu, 10 Nov 2022 00:43:10 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RL300JO6VWAJH12@mta04.eastlink.ca> for zsh-users@zsh.org; Wed, 09 Nov 2022 20:43:05 -0400 (AST) Received: from [192.168.0.3] ([24.207.18.108]) by Eastlink with ESMTPSA id svero3NngXZnZsveroOE2J; Wed, 09 Nov 2022 20:43:05 -0400 X-Authority-Analysis: v=2.4 cv=I9+jBvsg c=1 sm=1 tr=0 ts=636c4919 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=4hylopLo1UL-w0knJeIA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfeefgddviecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfvffhufgtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepveehudegteeiveevieeutefhffelheekueeghedthefgteejvefhgfekhfeigeffnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrfegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: -100 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Wed, 9 Nov 2022 16:43:04 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Content-language: en-US To: Zsh Users From: Ray Andrews Subject: coloring substitution seems to eat next line. Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28354 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: So I'm trying to replace a sed with native zsh code.  This stuff in inside a 'for' loop with 'aa' as the counter and  '$filter' is 'zsh':     cc[$aa]=$( print -r $cc[$aa] | sed -rn "s/($filter)/\x1b\[$color;1m\1\x1b\[0m/${sed_case}gp" ) ... that's the sed version working fine.  But this:     print "going in: $cc[aa]"     cc[aa]=( ${${cc[aa]}//(#b)((#i)${filter})/$'\e[31;1m'${match[1]}$'\e[0m'} )     print "coming out: $cc[aa]" ... almost works but it seems to eat the next element of the array every now and then with no pattern that I can discern. /aWorking/garbageZSH              colored /usr/share/zsh                            colored /aWorking/Zsh                            disappears going in but seems to be there going out , but not colored /aWorking/Backup/Zsh                ditto /aWorking/Zsh-55555                  colored /aWorking/Zsh/Zsh-5.8                no color as with above /usr/share/doc/zsh-common        ditto ... however if I make the output array different from the input array everything is fine.  But I've always had success with that sort of array being overwritten by some manipulation of itself, tho it seems dangerous.  sed has no issue with it.   Anyway, the expansion seems to interfere with the the clean separation of the elements that I'm hoping for.  Using a separate output array is fine, still I'm curious as to what's going on.  In particular the way some lines seem to disappear going 'in' -- I print the array element -- and get nothing at all, but there is output ... which seems impossible (tho it's never colorized).  It seems the expansion/substitution is ignoring line endings or some such.   I don't doubt there's some logic to what's happening but I sure don't get it.  It hasta be line separated.