Open eugenesvk opened 1 year ago
Both this as https://github.com/Peltoche/lsd/issues/795. They seem useful on the surface, but I can't think of a usecase where one would need this.
What deeper meaning do you seek if clarity of output and differentiation between permissions (along with https://github.com/Peltoche/lsd/issues/800) is not enough?
I'm just wondering what would be a usecase where one would want to hide the common ones? Just wanted to understand the usecase to make sure we are getting the feature right.
I'm just wondering what would be a usecase where one would want to hide the common ones?
To avoid information noise. To easier see the diffs and spot inconsistencies. To save horizontal space. Also, you don't need to hide them, you can make them less visible
user with 👤 (or with blank space or _ or ...)
So the usecase is very similar to every other formatting option like colors and number alignment, which help organize and highlight relevant information
IMHO, it is a funny functionality, I would vote +1 for this feature.
the only concern is which symbol can represent the meaning of the default user/group.
using icons is a great option, but we still need a text solution if we really want to do this
the only concern is which symbol can represent the meaning of the default user/group.
using icons is a great option, but we still need a text solution if we really want to do this
Not really, you don't need to have any solution, all this input can come from the user, who can abbreviate to whatever they like, a simple me
or def
or anything more fancy
(btw, the icons above are regular unicode text just like in your unicode
format, not patched fancy
font icons or any images)
That's the beauty of a simple text substitution filter The default could still be whatever you have now, i.e., the full text name
To easier see the diffs and spot inconsistencies.
What I am looking for was to understand when one would need a feature like this. What would be a situation where you are looking for files that are not by the current user where something like ls -l | grep -v 'user
or a find command isn't better.
Also, you don't need to hide them, you can make them less visible
This seems like a less obtrusive way to do this where we can use a fainter color for default values. Having a text substitution seems like too much. Same can probably work for https://github.com/Peltoche/lsd/issues/795 as well.
What would be a situation where you are looking for files that are not by the current user where something like ls -l | grep -v 'user or a find command isn't better.
grep or find could do this, but we have to do 2 commands, lsd and grep/find, every time, in most cases, I only want to know the general overall in a glance.
What I am looking for was to understand when one would need a feature like this. What would be a situation where you are looking for files that are not by the current user where something like
ls -l | grep -v 'user
or a find command isn't better
Any situation? Why would I need the mental overhead of extra filters when I can simply use lsd
as usual and get this for free? Also your grep is only for the user, but the proposed solution covers both the user and the group, so you need to adjust grep for that. Also, what about persmissions, that's also related, that's another grep.
This seems like a less obtrusive way to do this where we can use a fainter color for default values. Having a text substitution seems like too much. Same can probably work for #795 as well.
`
2in some color is more visible than
1in one color
2` in another colorAlso, text substitution would also work for:
Colors don't allow you to save precious space in a dense table
Even if we have one entry that is not the default value, we will end up taking up the space for all entries. So don't think this change would make a huge difference.
is more visible than
This is arguable IMO
customizable size labels
The problem with this is that we are adding more surface area without a strong usecase (as of now). Also, how would an interface for this look like?
I'd love to remove the uselessly wide 3-letter days with a single letter
What do you have in mind for how we customize this in lsd? Providing text substitutions, while it a general solution, I don't think is a good one in this particular situation.
Even if we have one entry that is not the default value, we will end up taking up the space for all entries. So don't think this change would make a huge difference.
Of course it would, for the most obvious reason — when you abbreviate values (root
to r
), then the space for all entries goes down. Also if you abbreviate username
to `` (and it's very common for all files to have the same) then you don't even get this column shown at all, so you also save on the padding space.
For example, not taking file names into account, I have a line of ~47chars, out of which ~15 is for the username/usergroup, that's a saving of ~30% if fully eliminated and ~25 if non-defaults are abbreviated This is a huge difference! And colors simply can't match this
This is arguable IMO
So what's you argument that two dimensions of change (nothing→something and color1→color2) is less visible than just one?
customizable size labels
The problem with this is that we are adding more surface area without a strong usecase (as of now).
I fail to understand the weakness of saving a lot of space, using proper and common tabular alignment in a table for numbers, while at the same time increasing readability
Also, how would an interface for this look like?
As a very simple text/regex substitution?
# a simple match or a regex sub
# with a more general soulution you can have 'user-name'/'group-name'/'date' as subfields to a 'substitution'
user-name-substitution : #
- username '' # simple text sub 'username'→'' blank
- root '🔐' #
- regex ['username1|username2','']' # regex sub of either of the user names→'' blank
group-name-substitution : #
- staff '' # blank
- wheel '☸' #
- admin '🛠' #
- regex ['group1|group2','']' # blank either of the group names
I'd love to remove the uselessly wide 3-letter days with a single letter
What do you have in mind for how we customize this in lsd? Providing text substitutions, while it a general solution, I don't think is a good one in this particular situation.
Why not? It's a great common tool that I can use anywhere that would solve several of the opened issues More customizing power to the user!
I still don't think text substitution is a good choice. We can probably detect the current user and default group names and hide it automatically, just wondering what to replace it with or what the flag should be.
Just FYI, you can reduce the size of the ls display by choosing the blocks that you want to display. This is how it looks for me and I hide the user, group column unless I want explicitly take a look at it.
More customizing power to the user!
Not to sound like a fun killer, but the problem with it is that it adds unnecessary maintenance burden when you have features that are not very useful, but touches a relatively large chunk of the codebase.
unless I want explicitly take a look at it.
And then you'd need to remember which flag to use or edit a config file, which is such a waste! With my propoal I can just always use one universal l
command that will be smart enough to show me all that info in a more dense, but also more readable way vs. what is currently available. So you can "explicitely take a look at it" just by looking at the column
With text sub you could also replace
2 months ago
2 weeks ago
2 day ago
2 months ago
2 weeks ago
2 day ago
or even better (the ago
is useless as always know it's the past from the context of the column)
2 mon
2 wk
2 d
That's the design power of generic substitutions
For a lot of contexts when browsing your files, you expect the permissions to be, for example,
user staff
, so it's just visual noise and extra column width to see these in every single line. This also prevents you from easily spotting something less common, e.g., some root file.As an illustration, notice how easier it is to spot that there is a different group in one file, and another one is owned by root, in the second example vs. the first
One solution would be to have different colors, but I think a better one would be to allow a more general text filter substitution, e.g., it would allow you to auto-replace any occurence in the
name
column:user
with 👤 (or with` blank space or
_` or ...)root
with 🔐 ... likewise, it would allow you to auto-replace any occurence in thegroup
column:wheel
with ☸admin
with 🛠