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=-2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,URI_NOVOWEL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28424 invoked from network); 9 Jul 2022 05:42:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Jul 2022 05:42:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1657345335; b=PlFLvGjLpBctIXAOM8YToeHcHAk/VBeQZ+TIIwSnHeYQqdVSNnLuyMHAYxFRXia4tjnzreCDNs tu4BkpaG0vNi9QYm5avYj+AdfZLcYOP+fgEBCmQiQHILrIMC3m9LQTc4LEXdoUcM6WMj42e6Qu u0YE7Pd/0CO3FbZRuTj5uXgZA2gtcRy3875GGlbO06AfW/EJoSu/yK8L/5VMdpTR1dg3kfcNPb hyLmkFSpEbbQjZuFYe6FfDqKzwnf/Y8m+6e4Xo9ZaWKevYXsFmUL2c73AWVGFrG+sR/h7HWZQ2 WSATlge0aD9d5aTIY1HXD9TNAtcLh4xbD5WamaIufhUibQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=luffy.cx header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=pass header.from=luffy.cx; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1657345335; bh=oer+AFrqQrXRGxDNmafJmXIbMenqLbUwR6ISDNkQyiM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=jglTx/0UFiTCkCe3Ha3Ej4yTp6Jyn3SEcxbK6VfGBdlyvI5jJUSsevysYOm+Sxj7/7SxwTrZqc dUezdRN6JdTGosPNby2RUMrY8wq9DDoQe04WjeslcqsmNeSy6w3T8RRDUAFas4iipAGXg469DE cnEbPgMccxJvE0jEnOU3j4vHxM/pvhSXTH0pcY26ThaqJvKQuUlBUpx3roPaXA8IDORHNe8rWj cnc2tpRDKVBFAZG6A0T/xe5I3fqNpQ/ZwcXCAqpwSAWrWIPpVMuvii8Kq8AEdtyUsMQEpNuxiZ +fLKllkG2kx0l5CjxSseOnUIUo4ZAepmsuN65q8ajtOhTA==; 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:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=uJ3rdFo4tkleU96/MdejH8fta9ohPNzwYO+JcvKlGUo=; b=N4+iacVDMqIntbqCL5seRyDQCn jxD4FxRUadImcYD/9e0oDDk3ULwwPdtqJPlVzNMOS9GnZCnEt9dLa08jyBbRDE/1KwNLMRYQ2zOn5 +hm+LM6uGfyz+kIsfD/70DwE3VRRdw64mTsxNy8cXw/bZYnUUiv6eCPF3c1XO0TAIB5WRqzePORj6 SXHM8mmRQvBMdtxWWuSRHIwROE00acOIxgwM7oIio5tSP0ArcYfSxVlGBrZbnmm3RcBlC4BkdmGVW WqhQS5uQRYtVdlyRAIXGGFDMk5PF13dwRRMTCNOQ/V13GkAv/qxBGDadYBoMhGBywNtVIqG0KFYC9 T+6Y+iwg==; Received: from authenticated user by zero.zsh.org with local id 1oA3EM-0007tL-95; Sat, 09 Jul 2022 05:42:14 +0000 Authentication-Results: zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=luffy.cx header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=pass header.from=luffy.cx; arc=none Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:58137) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oA3CZ-0007CY-Ig; Sat, 09 Jul 2022 05:40:25 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 42D383200201; Sat, 9 Jul 2022 01:40:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 09 Jul 2022 01:40:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luffy.cx; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1657345220; x= 1657431620; bh=uJ3rdFo4tkleU96/MdejH8fta9ohPNzwYO+JcvKlGUo=; b=F RHtek8kYLl8hhXX1PJIy5WAiUuFsEoOlSd0Ih7rche9bGsV7vM6uhZ78rQvhB5ez PrldO34QiwlfY/i/uXZM6nteupxmrn9bHOESEqZ+Z5RicEuTdTIatCK3k5uW2GZd njWJ8a88tGrfaWPzLqNtAaaK7/zGHFW9nQoJmpScYftmP5JMVjt8SjOLjPiyCefy J7H6zEiMPFLIC7DBnWLKXTNy1kRbvRu0W6y+XEcQPrDdbSMKEkFBjKW19bmdEBEH bBjVmJVC/6A9OqfDLnYxlzKzGYsqC6hHO+0j0iNfPwr/zwAdGyVkIpFyH5i4x8EH rDZnaiQEIHhHKR5PA8nAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1657345220; x= 1657431620; bh=uJ3rdFo4tkleU96/MdejH8fta9ohPNzwYO+JcvKlGUo=; b=2 hdcT6Bg3NcSHr3/X5wKrbLXSsj5mt1CE782lT4TSj66es0hYZUMxMfi5D7wX/XsL wDqrykqeLBfyZ8Yg7garFW6Ur9ekHQkvMHQOwfkqGg+nicieKr/hSIB76rIm+Ou7 cFU5HPwhetC78iUAB1MaCusxSCDFxj+C+i8Mv9ageR/YhUAFZZFBJKMChRrVYFrF de0irhMASePDfVGjDxbx94pupHeTAKTCDnj3wYLEWuZoIs/qaDrindNFbNFMAzyS 3z6TLcmdlHXknOWN9VysXEth5vdIy39/Q7POAcPjvp/xNnRrdMyNizTKfOHSmd0Y nWHeP2J2YP/I/iCZiLgVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeikedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeggihhn tggvnhhtuceuvghrnhgrthcuoegsvghrnhgrtheslhhufhhfhidrtgigqeenucggtffrrg htthgvrhhnpeelgefhiefhheeileegkedtueefveeugfeijedugfeitdekjeeugfetudek keefueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsvghrnhgrtheslhhufhhfhidrtgig X-ME-Proxy: Feedback-ID: i34d144f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 9 Jul 2022 01:40:20 -0400 (EDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by chocobo.luffy.cx (Postfix) with ESMTP id 4BE993FB2E; Sat, 9 Jul 2022 07:40:19 +0200 (CEST) Message-ID: Date: Sat, 9 Jul 2022 07:40:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Thunderbird/103.0 Subject: Re: Magic URL quoting and bracketed paste gets "disabled" randomly Content-Language: en-US To: Bart Schaefer Cc: Zsh Users References: From: Vincent Bernat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 27881 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 7/9/22 05:10, Bart Schaefer wrote: > On Wed, Jul 6, 2022 at 11:13 PM Vincent Bernat wrote: >> >> zle -N self-insert url-quote-magic >> zle -N bracketed-paste bracketed-paste-magic >> >> It works fine, but after some time, [url-quote-magic] stops working. >> Bracketed paste never stops working. > > First thing to check is whether any of your widgets have become > re-bound somehow. > zle -l -L bracketed-paste self-insert > should return > zle -N bracketed-paste bracketed-paste-magic > zle -N self-insert url-quote-magic I am using autosuggest, so I get: 07:22 ❱ zle -l -L bracketed-paste self-insert zle -N bracketed-paste _zsh_autosuggest_bound_1_bracketed-paste zle -N self-insert _zsh_autosuggest_bound_1_self-insert > If that hasn't changed, does url-quote-magic work when just typing in > a URL without pasting? It does not work either. > If so, next I'd try > exec 2>/tmp/zshuqmtrace > functions -t url-quote-magic > and then paste a URL. See if you get anything in that trace file. url-quote-magic ❱ setopt localoptions noksharrays extendedglob url-quote-magic ❱ local qkey='\?' url-quote-magic ❱ local -a reply match mbegin mend url-quote-magic ❱ [[ '?' != \\\? ]] url-quote-magic ❱ local lbuf='http://kjfkjkgjf/fgkfjgkf\?' url-quote-magic ❱ [[ 'http://kjfkjkgjf/fgkfjgkf?' == http://kjfkjkgjf/fgkfjgkf\? ]] url-quote-magic ❱ local -a words url-quote-magic ❱ words=( 'http://kjfkjkgjf/fgkfjgkf?' ) url-quote-magic ❱ local urlseps urlmetas urlglobbers localschema otherschema url-quote-magic ❱ [[ 'http://kjfkjkgjf/fgkfjgkf?' == (#b)([^:]##):* ]] url-quote-magic ❱ zstyle -s :url-quote-magic url-globbers urlglobbers '|' url-quote-magic ❱ zmodload -i zsh/parameter url-quote-magic ❱ reply=( noglob '=' globurl ) url-quote-magic ❱ zstyle -s :urlglobber url-other-schema otherschema '|' url-quote-magic ❱ [[ 'http://kjfkjkgjf/fgkfjgkf?' == noglob|=|globurl ]] url-quote-magic ❱ localschema=' ' url-quote-magic ❱ case http://kjfkjkgjf/fgkfjgkf? (*['"]*) url-quote-magic ❱ case http://kjfkjkgjf/fgkfjgkf? ((\ ):/(|/localhost)/*) url-quote-magic ❱ case http://kjfkjkgjf/fgkfjgkf? ((http|https|ftp):*) url-quote-magic ❱ [[ '' == *\?* ]] url-quote-magic ❱ zle .self-insert For some reason, typing manually an URL always failed, but not copy/pasting. It seems the condition if [[ "$words[-1]" == (#b)([^:]##):* ]] does not match. I am using "disable -p #" which seems to be the cause. Using "emulate -L zsh" at the top of the function instead of "setopt localoptions" fixes the issue. I though functions should use "emulate -L zsh" when using these options, but in Zsh codebase, "setopt localoptions" seems used often. Should any of this considered as a bug?