25
WTF is going on with my less
(sh.itjust.works)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
I'm using the fish shell. I checked, and there are no aliases for
lsorless.\ls --help | lessgives me the same result asls --help | less.That's surprising. I have an older version of coreutils (9.7 from Debian 13) that doesn't produce the links and formatting. I'm running bash and the behaviour you're experiencing isn't reproduced.
Aliases aside, I wouldn't expect the shell to be the cause. None the less, I installed version 4.0.2 of the fish shell and ran the same command in it and didn't see any control characters. But that's not really surprising - my old version of ls doesn't produce them. So I ran
ls | lessbecause even with my versionlscolour highlights files by type, but in the pipeline to less, there were no codes.If I run
ls --color=always | lessthen I do see codes in the less output.You might check your environment variables to see if CLICOLOR_FORCE is set.
Otherwise, I am out of ideas.
What terminal are you using?