zfs
zfs copied to clipboard
zfs list does not allign correctly after multi-byte characters
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
- Use a locale with multi-byte characters in dates (I'm using Swedish)
- Make take some snapshots, some of them on days containing multi-byte characters
- List the snapshots, in the example above I used
zfs list -rt snapshot -o creation,name,used,refer naspool/pub
FYI you should be able to temporarily correct this issue by piping the output to ' column -t '