broot icon indicating copy to clipboard operation
broot copied to clipboard

Option to enable auto refresh

Open zcourts opened this issue 2 years ago • 8 comments

First of all, great work! I've found myself using this quite a lot. Before my workflow included a lot of ls, tree, ncdu and other commands and I've now adopted to using broot for all of them.

One workflow I've not been able to reproduce is where I previously did watch tree -aDht /path/to/some/{dir1, dir2, dir3}.

I think there are two potential features in here:

  1. I'm using watch because it is a file heavy workflow and I'm monitoring what's going on with them. broot has a refresh but requires either hitting F5 or typing refresh (from what I've been able to work out anyway). The feature request here is to add an option to enable auto refresh after say 2 seconds (tree command default). That allows me to glance at the other monitor to see what's happening without needing to switch keyboard focus
  2. The second potential feature request is an option to expand the entire tree that is visible. I can't work out what rules broot is using to auto hide some directories. In my workflow, I need to see the entire tree. Not everything fits on screen, but that's fine. Ideally, I'll scroll into view the parts of the tree I want to be able to monitor right now and when broot auto refreshes, it keeps the same scroll position. If the tree has changed because a file was added or removed then scroll to the nearest sibling of the file or directory that has been removed. If files or directories were added, stay in the same position and anything that falls outside the view is just not visible now. In most cases I have a sub-tree anyway as shown in the example {dir1, dir2, dir3}. Here, I am choosing a sub-tree I expect to mostly fit on screen

zcourts avatar Aug 17 '23 11:08 zcourts

Auto-refresh using notify, that could be a feature.

Canop avatar Aug 17 '23 17:08 Canop

Do you mean sending desktop notifications?

zcourts avatar Aug 18 '23 05:08 zcourts

No, I mean refreshing on file changes, using a generalization of inotify. This is much more efficient than doing periodical refreshes.

Canop avatar Aug 18 '23 05:08 Canop

Ah, yes I think that makes sense! My description said refresh but I'd expect something like inotify, there's a notify crate as well.

zcourts avatar Aug 19 '23 09:08 zcourts

Yes, I know it (I'm the author of bacon, too)

Canop avatar Aug 19 '23 10:08 Canop

+1 on this feature request, want it badly for the work I'm currently doing

@zcourts thanks for sharing your watch tree command, using it now.

Dimagog avatar Jan 09 '24 01:01 Dimagog

+1 on auto-refresh.

VKondakoff avatar Apr 13 '24 04:04 VKondakoff