Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable column order (for long output) [feature request] #161

Open
Orangenhain opened this issue Apr 14, 2017 · 15 comments
Open

configurable column order (for long output) [feature request] #161

Orangenhain opened this issue Apr 14, 2017 · 15 comments

Comments

@Orangenhain
Copy link

It would be great to have an option to specify the order of the columns that are shown in long view.

Points to note:

  1. Could also be used to actually select what columns to output (so instead of requesting --links I can just specify that column. Alternatively one could have a certain order, but if the specific column isn't requested via command line, it's just dropped; but then, what happens if the order doesn't specify "owner" (because currently there's no way to disable that specific column)
  2. "name" might always have to be the right most, so terminal output doesn't wrap for each line in case of long file names & narrow terminal window. Alternatively an option to shorten the name column to make each line fit might be added
@ronaldknol
Copy link

I second this request.
If nothing else, exa should (with some flags) be able to output the same columns as ls.
mode links owner group size date time name

As a side note - I don't like your note on the main page which is "who doesn't want human readable sizes". I don't - for the simple fact that an "ls -l" will show me instantly the largest files (the longest number) and I can sort ls output on column 5.
With human-readable sizes I need to pay close attention to the suffix of the number, is it a K, M, G, T?

@ronaldknol
Copy link

Otherwise, I think exa is a great idea, and you have guts to take on a trustly old command like "ls".
+1!

This was referenced May 28, 2018
@dmix
Copy link

dmix commented Jul 11, 2019

Is it still on the roadmap to make each column hideable?

I’d like to hide the permissions one for my primary ls

@tborychowski
Copy link

tborychowski commented Jan 3, 2020

👍 me too!

FYI, the lsd does that nicely:
Screenshot 2020-01-03 at 15 43 47

(I just can't stand its non-configurable bright yellow for filenames)

@niedzielski
Copy link

I think this feature would be useful as well. Filenames are usually the first thing I want to filter output on. Since I read from left-to-right, I have to force my eyes to "jump over" to the far right of my terminal in the current design. I'd like to be able to put the filename column first to avoid this maneuver and also for consistency with the Nautilus file manager's default column order.

Thank you for making this wonderful tool! :+1 👍

@noperator
Copy link

Loving this tool. Since ls places the file size right before the date, I'm finding it hard to break the habit of expecting the size to be in the same place for exa. Here's what I mean:

ls:

$ ls -l test.txt
Permissions  Links  User    Group  Size  Date          Name
-rw-r--r--   1      cgross  staff  5     Nov 12 09:21  test.txt

exa:

$ exa -l test.txt
Permissions  Size  User    Date         Name
.rw-r--r--   5     cgross  12 Nov 9:21  test.txt

I don't mind at all that the Links and Group columns are omitted by default, but I would really appreciate having the option to place the Size column in the usual order that ls places it.

@carlfriedrich
Copy link

I really love exa, but the column order is indeed bugging me, unfortunately. I don't get why the size column has been placed between the permissions and the user. Permissions and user are semantically tied together closely, so why tare them visually apart like that? The size field is definitely annoying in between there.
So is this feature request on the roadmap for exa?

@robin-a-meade
Copy link

robin-a-meade commented Feb 10, 2022

A temporary workaround:

exa -lg --time-style=long-iso --color=always \
  | sed -E 's/^ *([^ ]*) *([^ ]*) *([^ ]*) *([^ ]*) *([^ ]* *[^ ]*) *(.*)$/\1\t\3\t\4\t\2\t\5\t\6/' \
  | column -t -s $'\t' -o ' '

Details at this gist.

@r3h0
Copy link

r3h0 commented Mar 27, 2022

exa rocks! Thanks for making it! In addition to my 👍, I have a small disagreement with the original request, and I have two ideas for how this flag could work.

Custom Order of 'Name'

I want to register respectful disagreement with this part of the original request:

  1. "name" might always have to be the right most, so terminal output doesn't wrap for each line in case of long file names

Even if the output is occasionally wonky with name being in the beginning/middle columns, I'd prefer to have the option rather than a hard limitation forcing 'name' to be the last column. At most, it might warrant a comment in the --help prompt for the --column-order flag, recommending that 'name' be the last column.

In the long run, there could be utility in a flag along the lines of this: --long-names=truncate/--long-names=wrap, but I don't think it's necessary, and I'd hate to see it hold up this ticket.

--column-order Usage (MVP)

Personally, here's how I imagine using this feature:

alias tree='\
exa --tree --level=2 --long --header \
--column-order=git,name,size,modified,user,group,permissions \
--git --icons --time-style=long-iso --group-directories-first --group \
'

The default value for --column-order is a list of all columns in their default order. Under that scheme, column-order is a "soft" option, impacting only the column order. Whether or not the columns are displayed continues to be controlled by --long and fields like --git/--group. For example, running exa --column-order=size,name is equivalent to running exa since --long was not specified.

--columns Usage (Fancier)

I like OP's idea that this could be used to "select what columns to output," in which case the flag would probably be called --columns and would imply --long. I would prefer a UX of exa --columns=git,name rather than today's exa --long --git. Here's how I'd use it personally:

alias tree='\
exa --tree --level=2 --header \
--columns=git,name,size,modified,user,group,permissions \
--icons --time-style=long-iso --group-directories-first \
'

However, I assume this approach would require more extensive changes, and I'd rather have --column-order if I could get it sooner.

@carlfriedrich
Copy link

@r3h0 I like the --columns approach and I think this would make exa a lot more flexible. The existing --long, --git etc. arguments could be kept imho, making the --columns argument only an additional way of providing these options. We would just have to define which arguments take precendence, and I think --columns should override the others in this case (i.e. columns=git would display the git column even if --git is not given, columns=user would display the user even if used in combination with --no-user, etc).
That way the change should not be that big and existing functionality would not be removed.

@faelin
Copy link

faelin commented Apr 19, 2022

+1 for the --columns=... option

@precompute
Copy link

Have the devs considered this? Is this being worked upon?

@ariasuni
Copy link
Collaborator

ariasuni commented May 8, 2022

Have the devs considered this? Is this being worked upon?

Yes, and no. I think it would be nice but it would also need some work.

@mpagot
Copy link

mpagot commented Aug 6, 2023

I like this idea

@julas23
Copy link

julas23 commented Oct 30, 2023

My perfect output:
exa --group-directories-first --time-style=long-iso --octal-permissions --color=always -lhFg -s Name | sed -E 's/^ ([^ ]) ([^ ]) ([^ ]) ([^ ]) ([^ ]) ([^ ] [^ ]) (.)$/\4\t\5\t\2\t\1\t\3\t\6\t\7/' | column -t -s $'\t' -o ' '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests