GNU bug report logs - #23191
ls alignment bug

Previous Next

Package: coreutils;

Reported by: Seth Kushniryk <sethkushniryk <at> linux.com>

Date: Sat, 2 Apr 2016 19:26:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Seth Kushniryk <sethkushniryk <at> linux.com>, 23191 <at> debbugs.gnu.org
Subject: bug#23191: ls alignment bug
Date: Wed, 16 Nov 2016 00:28:07 +0000
unarchive 23191
tag 23191 notabug
close 23191
stop

On 02/04/16 04:01, Seth Kushniryk wrote:
> I forgot to mention that this is coreutils 8.21 in Slackware
> 
> On 01-Apr-16 19:53, Seth Kushniryk wrote:
>> Hi, I've been having a minor issue with ls. It seems that sometimes the
>> character 'é' (e accent aigu) causes the rest of the listing to be
>> misaligned. My options are "-F -T 0".
>>
>> Here is an example of me using it in my music library:
>>
>> First Aid Kit/              Pink Floyd/                The Who/
>> Fleetwood Mac/              Queen/                     Ton Koopman/
>> Foreigner/                  Rage Against The Machine/  Trooper/
>> Frank Sinatra/              Red Rider/                 U2/
>> Félix Leclerc/             Rodriguez/                 Van Morrison/
>> George Harrison/            Roy Orbison/               Whitesnake/
>> Green Day/                  Run-DMC/                   Woody Guthrie/
>> Iron Butterfly/             Rush/
>> James/                      Simon and Garfunkel/
>>
>> Renaming the directory to "Felix Leclerc" fixes the issue. I think the
>> problem is in "ls.c" in the function "quote_name", and what it sets for
>> "size_t *width".

I think the problem is your locale settings.
It looks like the file is on disk in UTF-8 (where é takes 2 bytes),
while ls(1) is running in a single byte locale such as en_US.
In that mode those bytes are interpreted by ls(1) as separate
printable characters, resulting in the misalignment.
The -T0 uses spaces rather than tabs for alignment making
the issue more likely to hit.

The fix would be to set your locale to en_US.utf8 or equivalent.

thanks,
Pádraig




This bug report was last modified 6 years and 292 days ago.

Previous Next


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