Has anyone else noticed how the GNU ‘less’ command has been getting really smart, perhaps too smart for its own good? When you aim the command at a non-text file, it does its best to interpret the type and display it in a readable manner.
- source code: ‘less’ originally displayed the text unadorned. Now it calls some program to colorize the syntax, which is nice, except when it’s an inordinately large source file on a rather slow computer and the external colorizer program takes forever. Ctrl-C asks the colorizer to quit and allows ‘less’ to process with the regular text.
- HTML: ‘less’ used to show you the raw HTML text. The programs now formats the HTML the best it can.
- directories: ‘less’ used to advise you that the requested target was actually a directory. Now it offers a directory listing.
- ELF: ‘less’ used to inform you that the file appeared binary in nature and asked if you still wanted ‘less’ to try to display it anyway. Now it parses header information, apparently using ‘readelf -a’.
- binary: Like ELF, ‘less’ used to notify you that the data appears binary. Now it shows you a rudimentary hex view. This confused me the most. “Wait, does this file actually contain a text listing of a hex dump?” I then have to open a proper hex editor to verify that this is not the case.