I have a mixed language project with some Assembler files, which have file extension “.s”. When any of the source directories containing Assembler files are displayed in Files/Nautilus, the .s files are shown like this:
Other files (.c, .cpp, etc.) show as text files. Right clicking on one of the .s files shows the following:
However, the file shell command shows them as ASCII text files:
someguy@somesys:~/projects/someproj/src$ file mzzflt*.s
mzzfltc.s: ASCII text
mzzfltr.s: ASCII text
I’m quite sure that this behaviour started recently, although I’m not in a position to prove it. I have the same behaviour on two systems running Ubuntu 22.04 LTS. On one of the two systems, double-clicking one of these files still opens the file in gedit. On the other, it tries unsuccessfully to open it in archive manager.
Nautilus uses shared-mime-info to determine the mime type of file. Maybe that package got updated recently? You can also check what the mime type of a file would be according to that using xdg-mime query filetype mzzfltc.s to make sure the issue is not on the nautilus side.
Thanks Sebastian! shared-mime-info is at 2.1.2 (14 Jan 2022), so almost 2 years old. The output of xdg-mime query filetype mzzfltc.s is consistent with what Nautilus properties for the file shows.
So it’s a quirk of the file contents. I couldn’t find any <glob pattern="*.s"/>, so it seems that the initial “MZ” is determining the mime type. It’s clearly not Nautilus’s problem.