zfs icon indicating copy to clipboard operation
zfs copied to clipboard

zfs list does not allign correctly after multi-byte characters

Open LinAGKar opened this issue 2 years ago • 1 comments

System information

Type Version/Name
Distribution Name OpenSUSE Leap
Distribution Version 15.4
Kernel Version 5.14.21-150400.24.18-default
Architecture x86-64
OpenZFS Version 2.1.5-1

Describe the problem you're observing

zfs list does not align correctly if one of the columns contains multi-byte characters. This can be seen in the excerpt below:

fre aug 26  2:00 2022   naspool/pub@autosnap_2022-08-26_00:00:01_daily       18.6M     6.98T
lör aug 27  2:00 2022  naspool/pub@autosnap_2022-08-27_00:00:02_daily       18.6M     6.98T
sön aug 28  2:00 2022  naspool/pub@autosnap_2022-08-28_00:00:02_daily       18.6M     6.98T
mån aug 29  2:00 2022  naspool/pub@autosnap_2022-08-29_00:00:02_daily       18.6M     6.98T
tis aug 30  2:00 2022   naspool/pub@autosnap_2022-08-30_00:00:02_daily       18.6M     6.98T

It looks like it's counting the å/ö as two columns, because they're two-byte characters, although they're printed as one character.

Describe how to reproduce the problem

  1. Use a locale with multi-byte characters in dates (I'm using Swedish)
  2. Make take some snapshots, some of them on days containing multi-byte characters
  3. List the snapshots, in the example above I used zfs list -rt snapshot -o creation,name,used,refer naspool/pub

LinAGKar avatar Sep 08 '22 07:09 LinAGKar

FYI you should be able to temporarily correct this issue by piping the output to ' column -t '

kneutron avatar Nov 16 '22 17:11 kneutron