doronbehar / pistol

General purpose file previewer designed for Ranger, Lf to make scope.sh redundant
MIT License
322 stars 7 forks source link

Archives: Make it possible to configure what columns will be displayed #61

Closed lucas-mior closed 3 years ago

lucas-mior commented 3 years ago

Hi, I find that the Modification Time columns takes up much space and isn't really useful. I mean, when I go over, say a .zip file, I want to quickly know the contents of it. Currently I can't see the complete names of the files inside it because of the aforementioned.

lucas-mior commented 3 years ago

I can think of two possible solutions:

doronbehar commented 3 years ago

I have thought about this issue in my local TODO for pistol for a while. Ideally, it'd have been best if there was a configuration environment variable such as $PISTOL_ARCHIVE_COLUMNS which would decide which columns would be printed. Regarding the suggested alternatives: The main concern which made me decide to print the file names at the end was that their length which usually is the longest, wouldn't destroy the prettiness of the output. Putting the file names at the beginning and the rest of the info afterwards is a bit harder to do because the maximum length of the filenames should be calculated before you print a single line, if we want to give the effect of a table like output..

doronbehar commented 3 years ago

We can also not print that column at all since it takes up a lot of space which isn't much of interest, or perhaps to shorten it a little, so only the date would be printed, or perhaps make all of these combinations configurable via an environmental variable.

In anycase, putting the file names to the most right is I think a constraint that we can't avoid, unless we won't mind making pistol slow for big archives.

lucas-mior commented 3 years ago

I see, so I think the configuration via an environmental variable is the best solution. Although removing UTC info from that column would already make a difference:

2020-11-12 21:30:21 +0000 UTC
2020-11-12 21:30:21