GNU bug report logs - #52252
Escape sequences treated as visible characters, long characters split

Previous Next

Package: coreutils;

Reported by: Fabian Röling <fabianroeling <at> googlemail.com>

Date: Thu, 2 Dec 2021 23:59:02 UTC

Severity: normal

To reply to this bug, email your comments to 52252 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#52252; Package coreutils. (Thu, 02 Dec 2021 23:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Fabian Röling <fabianroeling <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 02 Dec 2021 23:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Fabian Röling <fabianroeling <at> googlemail.com>
To: bug-coreutils <at> gnu.org
Subject: Escape sequences treated as visible characters, long characters split
Date: Fri, 3 Dec 2021 00:53:40 +0100
[Message part 1 (text/plain, inline)]
"fold" includes the character '\e' and each of the following characters
that are used to format text as if they were all visible.
Example:
echo "a\e[3mb\e[0mc" | fold -w1
Result:
a




*b*




c
It still formats correctly, it just breaks too early.
Special characters can even be broken up.
Example:
echo "君の名は" | fold -w1
Result:
�
�
�
�
�
�
�
�
�
�
�
�
In case this appears invisible or otherwise different: It's 12 lines with
one "tofu"/U+FFFD/replacement character each.
I would maybe expect issues like this when the "-b" option is given, since
that counts bytes, but it happens even without it.

While trying to work around this, I noticed a similar issue with "wc":
echo -e "\e[3ma\e[0m" | wc -cm
     10      10
I have not investigated this further so far.
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.