Open ivovegter opened 10 months ago
Currently there is --no-quotes
or smth I believe
Yes we have --no-quotes
, but I think it's reasonable to have an ENV VAR:
EZA_QUOTE_STYLE
which can be maybe literal
or shell
to kind-of match LS?
or we could always go with always
auto
or never
because LS technically does offer everything to be quoted. so auto would be only if there are spaces in the file name, always and never are obvious.
Thanks. I somehow missed --no-quotes. That will solve my problem in the mean time. Getting it as close as possible to a drop-in replacement to ls would be good, though.
Just remember that we are waiting on #569 to get merged so currently the --icons flag might cause some misalignment when combined with --no-quotes.
Also, I looked into what LS supports and I dont believe we need to support so many quoting styles, but I went ahead and made a PR to support always, auto, never
so you could simply set EZA_QUOTING_STYLE
=never
or choose to pass it in the command line.
Several years ago, coreutils (ls) was controversially changed to enclose filenames that contain spaces (or other characters that would need to be escaped in input) in single quotes, by default. eza does the same.
The reasoning was to permit the output of ls to be used as piped input to other programs.
Unlike ls, however, eza does not implement the -N switch that removes those quotation marks, nor does it respect the QUOTING_STYLE=literal environment variable, which also makes ls list files without single quotes.
Please implement both the -N switch, and reading the QUOTING_STYLE environment variable, to determine whether or not to enclose filenames with special characters in single quotes in the output listing.