From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gA/hApWh4WB+/AAAgWs5BA (envelope-from ) for ; Sun, 04 Jul 2021 13:55:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SBBAOpSh4WA6YAAA1q6Kng (envelope-from ) for ; Sun, 04 Jul 2021 11:55:00 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0DA7A1F5F9 for ; Sun, 4 Jul 2021 13:55:00 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A9B122907B; Sun, 4 Jul 2021 07:54:55 -0400 (EDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mail.notmuchmail.org (Postfix) with ESMTPS id AA71A26C01 for ; Sun, 4 Jul 2021 07:54:52 -0400 (EDT) Received: by mail-lf1-f51.google.com with SMTP id p21so5480334lfj.13 for ; Sun, 04 Jul 2021 04:54:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:subject:to:in-reply-to :references; bh=v9+3HxRa+6FeGCJSUnBfb9eOSz0ZIbsBFModGSmlKpI=; b=VqHSSCAbnkMihtjwrCvpfxqJRnCNVYCi8z0dVqKqDCgmTzGPKiK6gWkx7nX3my8uUS DsI3bExN2If3YDwIpcemj1J/PPV7DlxqVyI5m9Y5dURKZyg54/r9FtnbwC9d/8dMLFle vLv2Q9FdgH3zEZv01e37PRqCq/1D7eEZZN4l4Drc7OOz+RmilAI5YfOylK/q6I8slGpn +/YBzcnAdhlUHd2Z4Q7W/Q+rPW0Ub/0lzxsozgyyJkFX2oww/xH1cgk7rRdFDVIkJoZU EpLoEiIv6B3YNxUctL4UEJwHL4g8X020xY0XYWAeVeklBPDEE8beQgzHqfKDphGX4IIT fyfA== X-Gm-Message-State: AOAM532mIEHibx6d5ZtWvfq6y5aNhh5BMKjxM2RPg0MyXldWIzO4P7KK ygYpml+cwtwFBCCtpF7Ulrk= X-Google-Smtp-Source: ABdhPJwPPDLX4/bepLgrkSbTxsYPMbUBN4gYas2NQGMq9NIbT2xt9sJ/Q6o+zhX/P3WLt7xE6ecQYw== X-Received: by 2002:a05:6512:3765:: with SMTP id z5mr6531977lft.583.1625399691146; Sun, 04 Jul 2021 04:54:51 -0700 (PDT) Received: from localhost (88-112-11-80.elisa-laajakaista.fi. [88.112.11.80]) by smtp.gmail.com with ESMTPSA id m7sm1018656ljh.118.2021.07.04.04.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 04:54:50 -0700 (PDT) Message-ID: <60e1a18a.1c69fb81.6fa74.570b@mx.google.com> Date: Sun, 04 Jul 2021 14:54:49 +0300 From: Hannu Hartikainen Subject: Re: [PATCH v2] cli/show: add --format=pretty To: Tomi Ollila , notmuch@notmuchmail.org In-Reply-To: References: <20210619203838.275767-1-hannu@hrtk.in> <20210702203153.47289-1-hannu@hrtk.in> Message-ID-Hash: B3WYYVB7E3RCP6FSCCG3OS55MWCN4U7X X-Message-ID-Hash: B3WYYVB7E3RCP6FSCCG3OS55MWCN4U7X X-MailFrom: hannu.hartikainen@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625399700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vvgQnL6PxL7nr/z1QY8Olfy4LMuivwHqcnbfZf0hCLQ=; b=sem4pHC3h+NhEOZcxC8hyKW0I9ndUx8FXk/8d1mt2SkTMjkCDb8S/F+2C7gr6omAkSSRyL pZZi78qIH6+4Ni4AuYQ/YLYCROaNuCVW2VXbOKiRCddq32zTBfMDEXPraA7dgdNEvBDaNt cKU/KsWmcvP1q3EPgJ+tQBcMVlxwixNnnIPm79tNGJFH7mNqHFoalIkm/xX6Fx0YB+pteP FmwKynItyGwPkb+IFc7sl4nKfsS1BhSqAycebW4boZ2pwg01Zzv0t2yE41Q2PwpS3yp2KK 8HhN+c1IaE9w9bHIA21X+g9BlWxsGZIz9eeo6xiXbOGINtPliCorZMRF5uw8wQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625399700; a=rsa-sha256; cv=none; b=cv3aQJHR/4nROaWQsIdBTlfQ4ohcf/+NvxuqQ2Vwam6/sUzBBVxCzOqs4WM8ktNKGkDbuF 1RqocBOsg36cAY7Egm85S6qpRlBim0A9zPxJocXevSKh8YYgl11BfqHcGizDUwsYLDyRwP uW4kqdDS7p+0wJeGg5mo7dsRARVhjAxSKfFMxpVscJ3vgcA/EaOPtBXzaYKHywsiSLd4jQ EjdNewJssOjQ0B5/+VxbwbWg9LdMAr63nGVhWtPvAFX51uEfo5vDkHw3w4dOcuLBPF6My3 Jx1Nf0/7QI+d7LvOPg2UwSTEjVNKKC0oCml+5MYb1gL7usNUBNd6jWIQC3aNDw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.03 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 0DA7A1F5F9 X-Spam-Score: -2.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: srcY4HHha0IJ Thanks for the review! On Sun, 04 Jul 2021 12:40:59 +0300, Tomi Ollila wrote: > The code looks good to me, just that these "hardcoded" color values gives > me a bit of suspicion... That's true and I do think the colors could eventually be configurable, but right now I don't know how the configuration should work. Should it be a palette, should each header have a configurable color (and should the displayed headers be configurable too) etc. It's easy to make this hugely bloated so I'll avoid going there until I have a clear idea of a good, minimal approach. > the colors look OK when background is dark (black). on light background > (white) color 33 (yellow), color 36 (cyan) and color 32 (green) are > somewhat hard to read (in decreasing hardness)... Most terminals have user-configurable colors so I don't think this is a showstopper. But as I said, yes, it would be best to make the colors configurable. > I did not try to apply this and see how those looks like when displaying > real emails (no setup on this machine for now...) Here's a screenshot: https://i.imgur.com/7dlP7lt.png I'm happy to receive any suggestions but I think it's best to stay with the original 3-bit spec (SGR codes 30-37, or in practice 31-36: red, green, yellow, blue, magenta, cyan) if the values are hardcoded. Those are most widely supported. > One option would be to first send this without color support and then > add *configurable* color support -- I don't know which way is better > but as a rewiever that would be easier to accept... That's an excellent idea! I'll post PATCH v3 later. I don't really want to try real feature detection because some terminals have weird corner cases with their ANSI sequence support. `isatty` is what other CLI tools tend to use as default AFAIK. Hannu