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 2943 invoked from network); 7 Feb 2023 04:13:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Feb 2023 04:13:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675743208; b=CehUrCAkiOEGhWmW7v/0CkdB8kU27SQ7CEO+ZoSDiH3bULeMrwiqKxKezEfxFvaWzWxCZqvLX7 h5KKNS4QRf2KPPF3LNfbFsRJ5YUNt3H0e/Aoj2r26zrgym3znsViW90bagCxCcPa12hvSQ+hBT oOemWOhHd1ZLyhcoZZCXxqhArOa8blcQXkbKnCuCE3+VcOuYLhdRnOnukHjo2zvurny9B7qhas jv+bfj044py9ACiP7yyRaBU0Cw8Kogxuo8XzSFdSD8i5nIORxuffA01cGze6gicL8WSkhZQ2bt fcjPck8870i+DjOz/BZf/ZDUkyXCHyXjm5Iubb6cOzWN8w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1675743208; bh=/3pRGu0qPk+HY45cqDXwve07grIdaQyhiZFnT2vCdZ0=; 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=CWqU/W8PSX3f3F5DVTV4K+m0fPNQ9Egqz1SUPkmsM+YSvrSdkihbypbHkKcQtinSWHAzjveBZi ttD0DRf2vaB45HI9oftDmTRkGNIsIEJDMks4G3PyK6W1+HkGlx6ZSvTfePJBD7Xuk+/+nm6XbO ShCKdEc0WEQBv9D41Et6Vy6MzIK22NnbEhUDakg/VmNgkoHHF6WD/AvSHODoJuKFQeQEgx6gv2 8Axua+WMJHTep+8W67T6+LZuTAmjNyZ9NUIJM+1H/QPDlJNxSUHH9YsQvN0vsKJfwXYOnmP/xy ZsAwDiA6bADFYS2iF76sbVakGpzWMXXfHGLFLqOdTGJXFQ==; 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=q9Py536keiOcfW4D2sN2RQYfA8AqGS8DeF5Ktg0XUqo=; b=BvNUo+WuJtGC9/VqinDbI4HOfC mLUnNPVMBny+nm0T76/R8IlERXAGhDEz2pctFZm0dBeO5O39RhICbeBb0G3OWNijpNJwz5qVwTACq ktFNr97H6MqNuVmWmPW1VBsIWiJ6Gws4vYsaWthKSjy3ZtYP8tMOHIB+AiS2us77NKHr5QJP3tGxX dX1+kyO3e/N9Tsm78IrNQLn6TIqvsHC8YGRBKigsjPTzu+UsB850/rKidFYigYvdFJCZmkxWQyt3a cL7QG63tiHme8Qx7xLMNNknmuwXSgnsFACjO3jtn3EfG/fJscd/VSMgqwf8m7jQEXyyM2kymcqji5 ytD2ifvg==; Received: by zero.zsh.org with local id 1pPFME-0007mS-PE; Tue, 07 Feb 2023 04:13:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:43849) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pPFLc-00073N-4g; Tue, 07 Feb 2023 04:12:49 +0000 Received: by mail-ed1-f49.google.com with SMTP id m8so13806114edd.10 for ; Mon, 06 Feb 2023 20:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; 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=q9Py536keiOcfW4D2sN2RQYfA8AqGS8DeF5Ktg0XUqo=; b=6M4hBbijCuf38y/qZbriWyv/8/jXQyv5k8WTP/v0tXSxty218v9lIJA6tveijA1zkU RSm7bHRn2CYFOp1kewGRmOF47vj91jgtQdkJ2QUdpfrLoQ536o2LhsCrOEbJyrrLuLja jT5BXjF9B/YsgpTrJ9sweX5sVuhOqh1dERqPP3i0Yz3EsEDwz8RFLA3yEfXdiIb6TC42 1csncqs5/bz2r31QDUuGJAFF2wInnUHrY2GFTUQ56uKkDT5M6gscOno61rkaTCrnjdQv PhqgRl41XI84BcC/lFZHTg9u6RybNevJ3KTMoz0laAPfy0PDO8JT4y3nVqTbOHP9cW7v iJeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=q9Py536keiOcfW4D2sN2RQYfA8AqGS8DeF5Ktg0XUqo=; b=lDVB3WKo1JA7OQY+61uMqZvLlIW6QD/eF0pQb72URgdutr0xPSOCvbLXlHuo/zLFIN TVJdbk0kFU/D4t0q3QcecOuS1lBTOt8omVTF7SW9NpW0AaObFVELmsLIbQ6uX2U48pqK BRgiCNV0UPSQnVER2SWiYVzbrU+34BxvLKdylhOhCHM/+8+2Wxa4MJMHcq2AxMFhsxwQ 8PtjP7AdHj5xZfB6wqb3IDHwnysmK71gZCCunpiq1jmHNw9+z437XA7vK/uIM73J8weS 6ZhY30LdQWwdlPcxDq5eP2aC1rwGR6G+1h52ZWD4W3C9XL0yVY0Qg2raJkCTc+MjhJA+ a+Qg== X-Gm-Message-State: AO0yUKUGSBVChMsFfPhjGAKmmMlrpzM8RN1BjsI37PwGcIJnRWgxwOZ6 FwyO/vywluhMU7U6x0Qh54c1bJ4t+I5KVLL4kEnmOQ== X-Google-Smtp-Source: AK7set8LlwZQ1zFP82zFFiwv6DKbaYHiNxtv1GRsXp+Rnh2LcpaxroUCGwSh7QJ8o6P6jQBwCw20LRjrAa1Sw6jZbfI= X-Received: by 2002:a05:6402:320f:b0:4aa:c33c:1f56 with SMTP id g15-20020a056402320f00b004aac33c1f56mr268857eda.4.1675743167450; Mon, 06 Feb 2023 20:12:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 6 Feb 2023 20:12:35 -0800 Message-ID: Subject: Re: zsh/nearcolor module usage To: linuxtechguy@gmail.com Cc: zsh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 28907 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 Mon, Feb 6, 2023 at 6:54 PM Jim wrote: > > Unless I missed something, which I may have, I didn't see anything about = how to > use it. It is a bit obscure. The expansion of prompts section has a cross-reference %F (%f) Start (stop) using a different foreground colour, if suppor= ted by the terminal. The colour may be specified two ways: eit= her as a numeric argument, as normal, or by a sequence in bra= ces following the %F, for example %F{red}. In the latter case = the values allowed are as described for the fg zle_highlight att= ri=E2=80=90 bute; see Character Highlighting in zshzle(1). This means t= hat numeric colours are allowed in the second format also. In the section on Character Highlighting, we find fg=3Dcolour The foreground colour should be set to colour, a decimal in= te=E2=80=90 ger, the name of one of the eight most widely-supported colo= urs or as a `#' followed by an RGB triplet in hexadecimal format. And then in the entry for the nearcolor module The zsh/nearcolor module replaces colours specified as hex tripl= ets with the nearest colour in the 88 or 256 colour palettes that = are widely used by terminal emulators. > % print -P '%F{#ABCB8D}text%f' > > Question: Does anyone know any other ways to use nearcolor? I tried usi= ng the > parameter expansion flag (%) but nothing I tried worked. Parameter expansion with (%) should work. palegreenpants=3D"%F{#ABCB8D}pants%f" print -r -- $palegreenpants > As I said, unless I missed something, it would also seem useful to add a = usage > example to the man page along with how to load the module. A reference back to prompts and highlighting would be appropriate. > BTW, not all virtual terminals seem to use the parameter COLORTERM. > [...] If using the example in the man page, nearcolor would > never have loaded for xterm. That example is not intended to be exhaustive or necessarily even correct, it's just showing how to load the module only when some arbitrary condition is true. It's up to you to figure out the right condition to test. I'm not sure how to express that in the text.