Feature/Enhancement Request | Live-print the tree instead of building before displaying #4
Labels
beta
This issue or feature should be resolved or implemented before an official release
enhancement
New feature or request
Provide Context for the New Feature or Enhancement You Would Like
nomad
currently builds the entire tree before it is displayed in the terminal. While this is not an issue when runningnomad
within smaller directories, it becomes substantial when running it in very large directories like/
, for example. After runningnd
, it appears the command is hanging butnomad
is actually just building the tree in the background.Like what the original
tree
command appears to do, live-printing the tree asnomad
finds new files or directories would provide a better user experience.Explain Why You Believe This Would Be a Good Feature
Everyone loves a program that runs fast. Who actually likes waiting, especially for something written in Rust?
The hanging effect after running
nd
in big directories in the terminal may also cause confusion for the end user (ie. "didnomad
crash?").Is Your Request Related To a Problem?
I did not open a separate bug report for this since this is technically not a bug, but rather a performance issue.
Describe Alternatives You Have Considered
I have considered writing my own implementation of a tree-building library; however, I believe
ptree
is already a great crate, so why reinvent the wheel?Additional Context
This is currently just a limitation of the default method of tree building that the
ptree
crate offers, since I did not implement a customTreeItem
trait and just used the providedTreeBuilder
struct andprint_tree_with()
function to create and display the tree with custom formatting settings.I believe this feature may be fulfilled once I take a deeper dive into the inner workings of
ptree
. If it is not possible to do by just implementing my ownTreeItem
trait, perhaps I would have to modify the source code and maybe even open a pull request forptree
adding a live print option of some sort when I figure it out. If I do open a PR forptree
and it is not accepted, I will just have to fork my own version of the crate and include it innomad
's source code.The text was updated successfully, but these errors were encountered: