Today, I was doing some command-line stuff and then this happened:
ls --help|less
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
ESC]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-aESC\ESC[1m-a, --allESC[0mESC]8;;ESC\
do not ignore entries starting with .
ESC]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-AESC\ESC[1m-A, --almost-allESC[0mESC]8;;ESC\
do not list implied . and ..
ESC]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--authorESC\ESC[1m--authorESC[0mESC]8;;ESC\
It’s rendering ls --help with control characters. When I do ls --help|less --raw-control-chars it doesn’t show the control characters, and it looks all neat and pretty. Isn’t this the opposite of how it’s supposed to work?!
Is --raw-control-chars a toggle and some config is causing less to show control characters when I invoke it with no options? If so, where can I find this config and stop this?
This has absolutely no bearing on my work and my life in general except for the fact that I’ll go absolutely batshit trying to figure this out, because that’s how my brain is. So far, all of my web searches just confirm that less shouldn’t be working this way, but they don’t give me any way to fix it. Please help me, Lemmy!!!


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.