saulpw/visidata

Directory sheet shows wrong filenames with multiple dots / filename extensions

Closed this issue · 2 comments

Small description
When opening a directory, if the filenames contains multiple extensions separated by dots, such as file.tar.gz, then the "middle names" would be displayed twice, in this case, file.tar.tar.gz. Only the final extension is recognized in the ext column.

Expected result
In the case of file.tar.gz, filename should be exactly file.tar.gz.

As for ext, the current behavior should be preserved, although there are two possible solutions:

  1. gz as ext. This is the current behavior.
  2. tar.gz as ext. This would be convenient in the tar.gz case, but would be chaotic in the case of a.file.name.txt.

Steps to reproduce with sample data and a .vd

% ls
a	a.b	a.b.c	a.b.c.d
% vd -N .

Actual result with screenshot

 directory │ filename    ║ ext │ size#│ modtime   @║
 .         │ a.b.c.b.c.d ║ d   │    0 │ 2024-03-05 ║
 .         │ a.b.b.c     ║ c   │    0 │ 2024-03-05 ║
 .         │ a.b         ║ b   │    0 │ 2024-03-05 ║
 .         │ a           ║     │    0 │ 2024-03-05 ║

Additional context
VisiData v2.10.2
Python 3.10.13

Hi, thanks for including your version of Visidata. This bug was fixed in version 2.11. Your solution number 1 is what was chosen.

The latest version of Visidata is v3.0.2. If you can, give it a try. It's much easier to work with and to explore.

I just updated and the new version is even more pleasant to work with. Thanks!