pls icon indicating copy to clipboard operation
pls copied to clipboard

Add a tree view

Open dhruvkb opened this issue 2 years ago • 1 comments

Problem

One of the most requested features lacking in pls but present in its main competition, exa is a tree view.

Description

A tree view is very useful to see the contents of a directory, and it's subdirectories, and their subdirectories and so on in a single view.

exa has this feature, accessible with the --tree flag but pls does not. Adding it would close the gap, making pls's features a superset of exa.

Additional context

  • The feature must be compatible with the details view.
  • It must override and disable collapse mode.

dhruvkb avatar Aug 15 '22 07:08 dhruvkb

The tree view has been experimentally added in main as of commit 02303aa, utilising the refactoring efforts of prior commits.

Currently it is does not have very good performance and becomes very slow when there are lots of files in a directory (or its descendants) but work on improving that is underway. But at least, we now have all the features of exa, and more!

dhruvkb avatar Aug 28 '22 09:08 dhruvkb

Hi @dhruvkb, Listing directories recursively is an already heavy task. Instead of printing the entire result out in a go (I see you're using glob), generating and pretty printing the results as the directories are traversed could make it seem to appear quicker.

Something similar to the tree command on Windows

shreyass-ranganatha avatar Mar 11 '23 11:03 shreyass-ranganatha

I could have a go at it, if I were assigned. Do let me know if this issue is up for grabs.

shreyass-ranganatha avatar Mar 11 '23 11:03 shreyass-ranganatha

https://user-images.githubusercontent.com/94926409/230444125-2bde9fa9-e7f5-4e65-8c67-2f60967b67fd.mov

shreyass-ranganatha avatar Apr 06 '23 16:04 shreyass-ranganatha