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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4776 invoked from network); 22 Aug 2023 06:27:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Aug 2023 06:27:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1692685679; b=jpTvjvJzV2C8VF7en5pR5C915P3uExThzVgSz18gRT16gh8tRHN1gusn6wnGtlrT+wxpaTDfqk 5B+JHBSo5EeedVkszIBzuVUlU3Uoh/BysQVPfAjPvEhV6tHsSRHRjjsqHJ3uKRodO71Gsp7Y6T yOb9BKnQajbXN19Gn4+FJSmoNJUT/mX/5Q654MKOWHTO1RglRWfb/n2/JKVyc4NXNKjoSw21N9 6dZPMck1Zb7pKKoVnvqUSD3QaHRK7EHUPlwv+TScdqIkMk6eZbXZxewrE2LFP9hAQhun/VRVuE eLp7GaezCA8eOuVAxa6jW63tZwX3jvbtXVES9CkMsGRD4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; 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=1692685679; bh=EIyuM7KUVfQJ/g0visaioJsmxWTvdHLk2IDLBgtVIxc=; 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:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=WO8tOR9YdMHt8TaRliKOv1TqdMA0wklK7AAvO9lHpg9khb4kEdT9c4cvHZgJaharbgdK1Yz1OT 3d1TwjOdnK+gNYYzBVbArtFaW5AV0V94JYIlmPqmRqJ7q0iUDwLXpAsb6gQj4cO6cpExn3kgO2 g2SWNLVMW6Ft9TWR2YW4ejc43Ch61ylqXXVFkNlHPE2ns8XScmGK3k9cZiq4ryVQHGSMTsILkL l9qeeOgiFk5mTeI6ECJHmFpKYH3uqnP0qlxUE4ZP6S625CLArOwJ4ai/8tJLgfBbuHB2k3zPRJ 4AoeRnwOyR6XvrEl8pmW3lv8Cqe8BgH0zvsRNJxG28FWfg==; 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:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZQs8ewvKaTmR/YhANavDuqjaltzCt91IdxrTNjzpbq0=; b=U8PtPZRdRsbraYC6Vdb5tghmbU qLTYrJgzIYYsAvqfuQFEXF9T7mFjaRq7nEaDpVU13W3ss+gkqVZpphdZ0/eCgMIJ7MEN+D4YxvwM9 cbE1zTqedD3r1cJBAmP0I2uae7D8CwLCoOOa9EXLUIqm19WcY8QfZPwxbS+B5vM3VaWlNLVs/Wnuj IdvK+fEu/ioKmERVe6+M4jycpl8/wIBR19UQK7oeElgXEwq6Xsm6XAgNJvnVgdvemhayeZotMMDCh SRmKYESVqORuSnfMWSYPT+z4y51wRbiCHGrRS4i5i1vS6Vow23xs9D6b2UwD5Cc16eaoxSrYiZRzo yDmifPdg==; Received: by zero.zsh.org with local id 1qYKrr-000EvL-Tp; Tue, 22 Aug 2023 06:27:55 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f181.google.com ([209.85.208.181]:45512) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qYKr3-000ECj-W8; Tue, 22 Aug 2023 06:27:08 +0000 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2ba1e9b1fa9so63599001fa.3 for ; Mon, 21 Aug 2023 23:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692685625; x=1693290425; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZQs8ewvKaTmR/YhANavDuqjaltzCt91IdxrTNjzpbq0=; b=Vx4rd4h/bpNSeumD0k8oKMj0asTbGeyjDOQDXb+avJ1Nii5V4uWdf/wnyklw3d8Bti Z+APZdLIpw4FVVwddX4t0G0KJcet6qVV72y1mqFlhvnlVa/FkdqGkaSPWfCruN0sOIAe 2Saz1wySV1pxIX6tfoblWAcd99a3XN6obE8j7FlkV2ycxkn2yp98C1Jzsx3Tqffrolg1 0vHzxTIOdREI/7RNPEjO12gQwG5ljKsi1gkyWmBfQ7cQbkl9DoJSv76UcvZ2TkPBnMjm 9JzL64g40sPmBhaLUF54pdH8c5fYpCimo655XJksex3OlX877J2A66crfHvis0pk8r8l mCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692685625; x=1693290425; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZQs8ewvKaTmR/YhANavDuqjaltzCt91IdxrTNjzpbq0=; b=hffR3FARJNCiUoM59qhlsdukHQyscag6FggUJdQY90NuCRvkhsO9AVy8uHd2130Z6i CHi6CSEgSGeSkHHdgwrC735ZuQV7OCOroXvSS+i2gPrkO0Zgrt6EYFtKggte/bHEYQyo fSYJc/7BUZO+V0fhXVZnmeoWMmyrJEcjq7cWdLbK6yvUqkHRnpO4vAJRw0/9d1Bb0F0u AH8Kkcn+0YESUVufZFHk8QXJMUNMYgHEupZYndviHwOktvigm1RCFXe+g+mSaW8QvyK5 ENv4NeO0NDfDY9BUI2BTqre3ng9xnnoWXOwTwgOKH5MGkNdiUsJNeBFN76k2wSbUXF1l ow/w== X-Gm-Message-State: AOJu0YwYgpjPfNA5pDzAG7zVFjsDmkjigdcNMjO9GBoAXvhDAT06rWUa nmKu24Zd55BMT6GshrzGDZBtz+z0cl6Lqr3REovwtWFI X-Google-Smtp-Source: AGHT+IFqvzVXRKZ2dzEEAnM4ZyojBym1dGOYWCmMOVUnqaRYywqTsvs32Vxo5E2kV9lD6pccg7IwgGahDuunIuW343o= X-Received: by 2002:a2e:9804:0:b0:2b9:e1dd:5756 with SMTP id a4-20020a2e9804000000b002b9e1dd5756mr5998451ljj.45.1692685624660; Mon, 21 Aug 2023 23:27:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Tue, 22 Aug 2023 08:26:51 +0200 Message-ID: Subject: Re: Help fix Zsh shell command prompt error or stranee To: Grant Taylor Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29177 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 Tue, Aug 22, 2023 at 1:37=E2=80=AFAM Grant Taylor wrote: > > On 8/20/23 1:30=E2=80=AFAM, Roman Perepelitsa wrote: > > In the vast majority of cases one can replace %{...%} with a > > first-class %-sequence. > > I question the "vast" quantifier. I'm intrigued. When is %{...%} necessary? These are the use-cases I know of, and I would venture a guess that they apply to a small minority of users: 1. To work around bugs in the terminal. For example, if the terminal displays "X" as a wide character, you would need to use "%2{X%}" instead of the plain "X". 2. To embed special markers at the start and the end of the prompt that are recognized by the terminal. 3. To use styling that isn't available through %-escapes. For example, italic, or dim. Are there any other use cases for %{...%}? Note that it's not necessary (and not a good idea anyway) to embed special terminal commands into prompt. Things like setting the terminal title, notifying the terminal about the current working directory, etc. These are better done by writing to the TTY in the corresponding hooks (precmd, chpwd, etc.). This is different from prompt markers that I mentioned above, which must be embedded into the prompt. Roman.