Relevant except below, bolded is the key point.
-v
prints non-printing characters in a visible representation. Making strange characters visible is a genuinely new function, for which no existing program is suitable. (sed -n l
, the closest standard possibility, aborts when given very long input lines, which are more likely to occur in files containing non-printing characters.) So isn’t it appropriate to add the-v
option tocat
to make strange characters visible when a file is printed?
The answer is "No." Such a modification confuses what
cat
’s job is concatenating files with what it happens to do in a common special case showing a file on the terminal. A UNIX program should do one thing well, and leave unrelated tasks to other programs. cat’s job is to collect the data in files. Programs that collect data shouldn’t change the data; cat therefore shouldn’t transform its input.
I accomplish the same thing with compose sequences, and by binding a keyboard shortcut in my desktop to call a script with
wtype
. It's not a cross-compositor solution though, as you'd have to manually setup binds in each of them.I don't see much hope for this one-to-one unfortunately.