From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id D5CDD21503 for ; Wed, 24 Jan 2024 09:54:54 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1706086494; b=diAXY178q6BhYTy522jeL5G3HkOOBYM1xarLocv+nxDNnsGzbkzaNmSaVKnQZAsJq62dD2veXO cIRO0LrVGzpSDqfzhztHb2UgfJLfzpWv+jSxLELsSWLa8bZBiTrx/lnVwdwgME2tCGm8OMJfQe xWspRKCdRoVrSw2vxW0u/JJmiWMOMfa0LbH54Wcn20GSQz8cFwJL+sQL4bn1XfJIk/P4RVRJtK uxTqmv2y5pVORmqZ9MSDnw9k+z7sQ8SGKcQ1ZK0N3Vebk+2tr3NW0KyZb72DoZ+qonVfhecJCH vLYX10FDVum2WRZCAEjr6aeKPBLOLYZZZnBalvUXRDcsyw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=gmail.com header.s=20230601 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=1706086494; bh=+2Z+z8F7Ol4ji6xFgChmk1FTNOCBtqCegeRqsczs8rE=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=pG5GxKUfS+Ff5YPxAESnwErkAo0s2aWCKCjyEv4YETx6kGCCulg8ihNdWM/f35pyPY7O+KZ7ZR P171ygjMHzqxidLPTE7CImkGkKwMT5ZnhY1qpBx6og1isrRpKMQyaYAe8f1DFwceHvs3KmkmJV elSaYmzvOPG/ueyr5j5bwokCk7kIPCrzsreCqJWe59GuZWtAih2vcSh1uYJ+BX3i5nLTHJXl22 WM1e6x5ClnUSKyhT55MqrUb8HucQo3KmDVTbWjUAvKROrGRGbrE1BuukYBgeiZVStDHCo2U0a8 7Uu5SseoDcAslKMSW3y2hPLEBaYGoNS1eBn7DGmF7astGQ==; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=zmSO5NMPZ+o9/f/j7H/MeJJt6HLsXhicTefN9W5uwY0=; b=nJUXB61Abt7AaUT/B0VJ+lhseb Nt/sFpKZq58zZ4NQw0LT/eJGpkYcgR/rHu8GzV1nGSQxnHdgQ6zMpGPGM1K9UFkn28xqyXaLpI2CR sZsLIzWfEtImw3f+7ostjysOIA0Cc8eUMEG1ZPSqcBXYyznt6PQE5edahQHtrSsyk93LSatYcp+VO lmKtpW7nw8QMEkCFaKaz7K2mzqIpNgtRqrf0GgYqUOn2jVz03bkIDcUncFVNE9jXaSLJqemZM9yw0 rYy7FpG6Fx0UAgB7SnboL7eKw9NpaXgybXauiZGonouLNoPoauxFDtlufKkJHYKSoE5/qV5MY6Oxr m6/nMppQ==; Received: by zero.zsh.org with local id 1rSZ23-000PAm-2D; Wed, 24 Jan 2024 08:54:51 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f45.google.com ([209.85.208.45]:58377) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rSZ0t-000OR9-95; Wed, 24 Jan 2024 08:53:40 +0000 Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-55a90a0a1a1so4421130a12.0 for ; Wed, 24 Jan 2024 00:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706086419; x=1706691219; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zmSO5NMPZ+o9/f/j7H/MeJJt6HLsXhicTefN9W5uwY0=; b=AS+OMPrlLeS/jrMnC5/4aYfWczy9O9w7D4W33H/Or63c7j98yPC61imz/R9u5xTfJn B5xSlfvtlPEZZZ53B1x2n316DoOmx2dFWTTq+YX0sWdLGPGCkK313T0UGk23oIKnyWNU naKr5/VNl42JHVZyzj/9oVNmB7a+02XjG4FZfJl0N/zYHGmJVkOt8lLJ7bMLJ9+mc9sM x/g5x238qPfAsIUAmckvB6aCVLvPl0bP/nWPVNzqd/OtZObhruKp2LeXx+WGPRhuZu8S 2Z4Zk6P+rTPGdzB22v+nZwT1y90rRrWf0lxZ+kHZWR5n/6YaR1INe8j6tvVZxh/HIHK3 dEoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706086419; x=1706691219; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zmSO5NMPZ+o9/f/j7H/MeJJt6HLsXhicTefN9W5uwY0=; b=kXL0HtQ3saO/3ed9Wh26yXonk66gWHLi3HBHMFBmD7F4isvQKrCw/fcisi/bTWv9FF Um4sgjnLFafqRFSGfbEsOfNa8IIhm4JLZCgh8ndwcEGgtCYinWqEuZavX87623/2PC2b HIsuV3EmXO4meP7XcqaVMHfGUUEfg8DMsEpKjEKdlqfYAqViZnDkRYFvZzTfMufVD2y8 s1aZu16PtQNoZoM8Z81p9oTepuRFVLXi+6yvP1ySLlpgwWg+4ySCNimfuAxuEOLfCd0+ M+2ototaqMfcxEFuP46RJ1JDAzX4fXMA6i8Yim0nBaGBOSj+LTAJagJJHc0giU+jQ9fv swjA== X-Gm-Message-State: AOJu0YzWRqZ2EdpLFxu1h47/cHhkCUvpAd2ekC+b+vKlGBMmXuzRkxvm sqLjHfnLavQ46vO1R/t7ge+RGaJnCYPrrMGqAOSmGZSDWbffzwmadpi42+Hyd0mig4MXt0crEMH 65sJDVgIzfrTXm8aF3hmUseNDkfY= X-Google-Smtp-Source: AGHT+IELo4JGlXVO1IoeH5Z+ksJsjb5gqJEOEi8AyzFVO095irCUUdi1zaxhiYbXtLG1X+x6VwsQHaekmbnV6Zntneo= X-Received: by 2002:a05:6402:5206:b0:55c:a808:1eab with SMTP id s6-20020a056402520600b0055ca8081eabmr386435edd.23.1706086418458; Wed, 24 Jan 2024 00:53:38 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:7208:429b:b0:7c:8dba:96f8 with HTTP; Wed, 24 Jan 2024 00:53:37 -0800 (PST) In-Reply-To: <35F0FA32-34D7-4BF6-978D-EBFC2427ABE8@gmail.com> References: <35F0FA32-34D7-4BF6-978D-EBFC2427ABE8@gmail.com> From: Mikael Magnusson Date: Wed, 24 Jan 2024 09:53:37 +0100 Message-ID: Subject: Re: Why are prompt expansions of %v sequences quoted in bindkey style? To: Marlon Richert Cc: Bart Schaefer , Roman Perepelitsa , Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29551 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 1/24/24, Marlon Richert wrote: >> On 23. Jan 2024, at 22.21, Mikael Magnusson wrote: >> >> =EF=BB=BFOn 1/23/24, Bart Schaefer wrote: >>>> On Tue, Jan 23, 2024 at 10:44=E2=80=AFAM Marlon Richert >>>> wrote: >>>> >>>> However, the quoting seems to make it impossible to use $psvar for >>>> anything involving control characters. >>> >>> That's correct. Anything involving control characters would also >>> require %{...%} or %G to specify the occupied screen width. >>> >>>> Is there no way to work around this? >>> >>> As Roman mentioned, the usual way is to use precmd to update prompt >>> values. >> >> fwiw, you can do things like %F{%5v}hello or %(3V.%B.) to make things >> dynamic without using promptsubst or updating PS1 in precmd, but you >> do have to have all the actual formatting in PS1 then. >> > Thanks, I think that might work for me. > > I am indeed trying to use $psvar to dynamically update my prompt=E2=80=99= s visual > formatting, without the use of prompsubst or changing $PS1. Thinking about this made me realize that namerefs can be quite useful here,= eg typeset -n .prompt.logicaldescription=3D'psvar[3]' then you don't have to remember what number you decided to use for what (I always forget what I picked). And it makes code using them slightly more self descriptive. --=20 Mikael Magnusson