From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "René Scharfe" <l.s.r@web.de>
Cc: "Git Mailing List" <git@vger.kernel.org>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] column: use utf8_strnwidth() to strip out ANSI color escapes
Date: Mon, 14 Oct 2019 21:33:15 +0200 (CEST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1910142132360.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <a165b244-b18d-0434-42c5-bfe28b8bab51@web.de>
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Hi René,
On Mon, 14 Oct 2019, René Scharfe wrote:
> Am 14.10.19 um 13:13 schrieb Johannes Schindelin:
>
> > On Sun, 13 Oct 2019, René Scharfe wrote:
> >
> >> This changes the behavior, though: The old code skips all kinds of
> >> Control Sequence Introducer sequences, while utf8_strnwidth() only skips
> >> the Select Graphic Rendition kind, i.e. those ending with "m". They are
> >> used for specifying color and font attributes like boldness. The only
> >> other kind of escape sequence we print in Git is Erase in Line, ending
> >> with "K". That's not used for columnar output, so this difference
> >> actually doesn't matter here.
> >
> > Arguably, the "Erase in Line" thing should re-set the width to 0, no?
> > But as you say, this is not needed for this patch.
>
> It doesn't move the cursor, just clears the characters to the right, to
> the left or both sides, depending on its parameter. So ignoring it for
> width calculation like the old code did would be appropriate -- if we'd
> encounter such an escape sequence in text to be shown in columns.
Whoops, you're right. I brainfarted, mistaking it for `\r`... My bad!
Ciao,
Dscho
prev parent reply other threads:[~2019-10-14 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-13 12:49 [PATCH] column: use utf8_strnwidth() to strip out ANSI color escapes René Scharfe
2019-10-14 11:13 ` Johannes Schindelin
2019-10-14 14:16 ` René Scharfe
2019-10-14 19:33 ` Johannes Schindelin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.1910142132360.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).