2026-09-22 00:18 UTC
Replies (9)
-
@testman@lemmy.ml 2026-09-22 01:00
From what I see you are missing spaces around pipe (the | character)
-
@solrize@lemmy.ml 2026-09-22 01:16
Yeah use less -r. You can set that in your environment export LESS=“-EX -r” is what I use.
-
@quarrel4you@piefed.social 2026-09-22 01:35
One option is to use less -R to see the pretty colors. The boring option is to use ls --color=never and be sad.
-
@tangeli@piefed.social 2026-09-22 01:50
I would say your ls shouldn’t be working that way: when it detects that it’s standard output isn’t a terminal, it shouldn’t be outputting the control codes. Which makes me wonder what version of ls you are running.
-
@elmicha@feddit.org 2026-09-22 04:13
What’s the value of $LESSOPEN? These URLs in a manual page look strange.
-
@thingsiplay@lemmy.ml 2026-09-22 05:18
/usr/bin/ls --color=never --help | /usr/bin/less and /usr/bin/ls --color=never --help > ~/Desktop/lshelp.txt produces and contains the same characters, BTW. This happens in Bash and Zsh, using Kitty and Konsole terminals. So its not an issue with less, the shell or terminal. Meaning it might be an issue with ls itself. I have “ls (GNU coreutils) 9.11” from ls --version. Ah ls has an option for this: -q, --hide-control-chars But ls -q --color=never --help | less hides control characters, but the special codes are still there. Looks like an issue with ls.
-
@CallMeAl@piefed.zip 2026-09-22 06:54
Per the Gnu Coreutils NEWS file: All commands now markup option names in --help and man pages, with bold attributes, and hyperlinks into the online manual on gnu.org. The links can be configured with the --enable-manual-url configure option, and the bold highlighting with --disable-bold-man-page-references. At runtime all markup can be disabled with the TERM=dumb env var value. This has nothing to do with less (or bash or fish). It is a new behavior as of Coreutils 9.10. It is to preserve the hyperlinks in the help output of ls, cp, rm, mv, etc. In default mode, less catches these control codes and escapes them so you see the visual escape codes. If you use less --raw-control-chars then less is NOT escaping the control characters (just passing them through) and they get interpreted by the terminal as screen formatting codes. Debian 13, which ships Coreutils 9.7 does not have the change and cannot reproduce the behavior.
-
@syklemil@discuss.tchncs.de 2026-09-22 09:49
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?! You’ve gotten a longer reply to this, but just to make it clear: No, that’s how it’s supposed to work. By default less mangles control characters so they can’t do anything to your display (or bell) With -R, less will pass some control characters through raw and unmangled; enough to give you stuff like pretty colours With -r, less won’t mangle any control characters, which, if you’re doing something stupid like trying to read a binary file, can leave your terminal prompt fucked up and in need of a reset.
-
@TrollAccount69@lemmy.ml 2026-09-22 17:27
Sounds like it was more trouble than it was worth!