broot icon indicating copy to clipboard operation
broot copied to clipboard

Print the root path relative to the initial root

Open 9999years opened this issue 2 years ago • 3 comments

Allow printing the root path (the top line in the tree view) as relative to the directory broot is launched in.

This is supported in the usual manners:

  • As a command-line argument --root-relative-path
  • As a config file option root-relative-path
  • As a verb :toggle_root_relative

Here's how it looks, showing a sub-directory of the launch directory:

image

And showing a sibling of the launch directory:

image

9999years avatar Oct 11 '23 05:10 9999years

Can you please explain what you want to achieve and why ?

Canop avatar Oct 11 '23 05:10 Canop

Yes, I'll mark it ready for review once I have an explanation :)

9999years avatar Oct 11 '23 05:10 9999years

Relative paths are nice and I want to see them instead of absolute paths most of the time.

I'm also developing a broot integration plugin for Neovim and I'm using a snapshot testing framework. However, I can't get the tests to pass locally and in CI because I'm running them in different directories. If I can just view relative paths this isn't a problem.

I could also patch the snapshot testing framework to be able to ignore specific regions of the screenshots, as I've proposed here, but I wouldn't like to have to manually draw out those regions.

PS Thank you very much for Broot, it's very nice!

9999years avatar Oct 11 '23 06:10 9999years