! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Sort by name does not sort by name (with underscore characters in filenames)
Status:
RESOLVED: INVALID

Comments

Description hyper-nova 2018-01-22 16:57:14 CET
The following files are not sorted by name correctly:

c_cathode_time.C
c_cathode_time.pdf
c_cathode_time.png
cell8_out.root
c_feast_t0.C
c_feast_t0.pdf
c_feast_t0.png

This is the order in which they appear in Thunar.

The order should be either

cell8_out.root
c_cathode_time.C
c_cathode_time.pdf
c_cathode_time.png
c_feast_t0.C
c_feast_t0.pdf
c_feast_t0.png

or

c_cathode_time.C
c_cathode_time.pdf
c_cathode_time.png
c_feast_t0.C
c_feast_t0.pdf
c_feast_t0.png
cell8_out.root

depending on whether you consider the "_" character to come before "a" or after "z"... Usually it is considered to come before "a".
Comment 1 Andre Miranda editbugs 2018-01-22 19:23:11 CET
Actually the underscore is ignored while sorting the files.
This is not Thunar's doing, even Nemo, Nautilus and ls have the same behavior while sorting the filenames from your example.

From a quick Google I learned that this sorting is determined by LC_COLLATE, see for yourself:
pkill -i thunar; LC_COLLATE=c thunar
Comment 2 hyper-nova 2018-01-23 00:54:55 CET
Is this an environment variable? To use this, do I put LC_COLLATE=c in my bashrc or something?
Comment 3 Andre Miranda editbugs 2018-01-23 01:17:25 CET
Yes, it's an environment variable.
In the example I provided, it's set only for running thunar, but to make it permanent please refer to Arch's wiki:
https://wiki.archlinux.org/index.php/environment_variables

Here you can find more info about LC_COLLATE and Locale in general:
https://wiki.archlinux.org/index.php/locale#LC_COLLATE:_collation

Bug #14189

Reported by:
hyper-nova
Reported on: 2018-01-22
Last modified on: 2018-01-23

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
1.6.11

Attachments

Additional information