1448 points · by gilad · 6y ago · 287 comments
But I found one issue which might be a critical one:
When you start broot with "br --sizes", it shows you all the folder sizes. The tree than takes a while to render all the different files and folders, since they probably have to be recursively evaluated in size.
However, when you select a specific file, press space and then `rm` to delete it, the pointer might change to another file randomly. This is because the file list is still not rendered-out because of the file sizes beeing calculated, however, the pointer to the selected file should be persistant or you might accidentaly delete an important file.
In this case, I was flying through the file system like nobodies business in 1991 with Norton Commander[0]
A rope and pulley attached to a vertically-moving platform existed for a really long time, and then someone bolted on a ratchet, and it became an elevator, which (with some iteration, and marketing) gave birth to skyscrapers. Another one is LXC, which existed for 5 years before Docker's confluence of features (and impressive marketing) made it ubiquitous and changed the [backend] tech landscape.
From ~1990 to now (yikes, 30 years!), I've used these:
- Amiga: Directory Opus (DOpus)
- MSDOS: Norton Commander (NC)
- Windows: Total Commander
- Linux: Midnight Commander (mc)
- MacOS: Tux commander
Looking back at old Directory Opus screenshots tickles the nostalgic bone. I miss the colourcoded buttons.
I wonder if Directory Opus was the first 2-split navigator, but probably not.
In answer to your question of which was the first, the answer appears to be PathMinder (1984) and Norton Commander (1986). Both were for DOS so it seems to be an original innovation from the DOS world. Directory Opus first came out in 1990.
I wasn't familiar with PathMinder before looking at the wikipedia article but I was familiar with Norton Commander, as I think nearly everyone who used DOS in the late 80s would be. I personally favoured XTree (1985) more. Xtree didn't originally have the two pane view, but added it in 1989.
[1] https://en.wikipedia.org/wiki/File_manager#Orthodox_file_man...
Just as a data point, I tried that and I never could figure out how to populate the left pane and the right pane in such a way that it was helpful. (I.e. that copy and move did the right thing.) It just felt pointless to me.
I've used vifm a few times, but only after figuring out how to turn off the two-pane split :-)
De gustibus non disputandem, I guess.
https://books.google.nl/books?id=ki8EAAAAMBAJ&pg=PA34&redir_...
I love how "FORMAT your disk without leaving your spreadsheet" is a feature
Being able to format a floppy disc and continue to do things on OS/2 without applications becoming seriously jerky was also a feature. (-:
CentralPoint PC Tools seems little remembered nowadays. It was quite an extensive toolkit, as I recall. File viewers for various types of database/spreadsheet/wordprocessor files. Disc and file hex editors. Repair utilities. Extended directory change. A uniform look and feel, and a fairly good manual.
The Graham Utilities was another one.
* http://www.warpspeed.com.au/Products/OS2/GU/graham.htm
There seems to be no trace of things like InspectA (another OFM for OS/2) on the World Wide Web.
It was insanely good.
https://www.tecmint.com/wp-content/uploads/2016/06/Worker-Fi...
Its available on FreeBSD so it must be available on Linux and macOS at least ... not sure about Windows.
It's (also) ActiveX (generic scriptig host, COM objects from/with scripts, etc.) scriptable and fully configurable. Just like in the good ole' days.
Idk what happened exactly, but now I can’t stand commanders at all.
I've used it as a replacement for Total Commander on the Mac. Another posted posted Marta, which I just downloaded and it seems to have almost the same features as Total Commander but in a free/open source offering.
Forklift made some questionable choices in the version 3. The app became much slower.
To install - brew install nnn
The two-pane file browser (folder tree plus folder contents like Windows 95 Explorer, or two parallel panes like Norton Commander) was a compromise solution that has worked for decades.
But this idea of showing in context a limited view of representative items of each collection could be generalized and exploited in other generic data-heavy interfaces, where there's no business code to show the specific data loads in the best way.
I've also used Total Commander for a while. I haven't seen any directory or file manager that is better.
Far Manager is better, of course :)
Pictures illustrating exactly what it does, something many people/organizations cough oxide.computer cough don't do properly.
I'm not the most technical person but I could easily understand the purpose of the program by quickly scanning the webpage. The combo "clear headline + demo screenshot" is all that's required to explain what the product features are, and how I, as a user, can benefit from this product. There is even a blob of text available under each screenshot, for those who want to know a little bit more. (Reminds of "The obvious, the easy, and the possible" [1])
A lot of landing pages of SaaS products and other tech-related websites could benefit a lot from this "old" but straightforward approach, instead of trying to sell you a better lifestyle with "Be productive" or "Break free" or "Solve all your issues" marketing headlines.
[1]: https://signalvnoise.com/posts/3047-the-obvious-the-easy-and...
As you can tell by most of comment I think this isn't the whole truth and that really things live somewhere in the middle and that the domain and scope of interaction greatly shift this spectrum one way or another, picking a doctor/lawyer vs picking and IDE comes to mind for myself, YMMV with that example and might even further drive home the point.
Long story long, marketing is hard and the people doing the marketing often aren't domain experts and have to rely on the information passed to them through a convoluted game of telephone via authors and experts that can't even communicate everything needed to be effective because they themselves aren't good at teaching.
Looking at oxide.computer... man... what DO they do? Do they sell servers?
My other pet peeve for these kind of websites is when the landing page is full of just release notes and links to tangentially related articles news articles and talks about the product, and it takes me 10 minutes to figure out where I can actually read about what the heck product I'm even looking at, and why I would use it over other products in its class.
This XKCD about uni websites gives the general gist of what I'm talking about https://xkcd.com/773/
Some Github repos are also awful. The README should summarize what the product is or link to a website that does.
The Kotlin and Elm websites are pretty good: https://kotlinlang.org/ https://elm-lang.org/
It's hard to find some really terrible ones right now...
Apache products tend to take some effort to decipher what it is they even do or how they'd be used. They have a nice summary description like the start of a man page, but that's about it. https://ant.apache.org/ https://hadoop.apache.org/
The GitHub landing page is surprisingly worse than you'd expect. It's not terrible... but check it out in Incognito / Private Window and imagine you'd never heard of GitHub: https://github.com/
Compare the above, with how cleanly and clearly Travis-CI manages to express what it does, and why you would use them, along with a useful screenshot of what the UI looks like right near the top of the page, so you can get an idea of what it would be like to use in practice: https://travis-ci.org/
https://github.com/sharkdp/fd/ https://github.com/sharkdp/bat https://github.com/BurntSushi/ripgrep https://github.com/ogham/exa
* lsd - https://github.com/Peltoche/lsd
Have you compared `skim` with `fzf`? And `lsd` with `exa`?
Can I ask... why?
What is the difference between a program that makes you feel "oh boy this looks so good" written is some XY language, and the same program with the same functionality written in Rust?
Every non-standard tool that you get in the habit of using is another piece of friction when switching machines or using a machine not configured as your own, where you may not even be able to install things. With Rust, I know I’ll be able to get it going easily, regardless of whether it’s in some OS-level package manager: it’ll be a single binary that I can just drop into my personal bin directory, and it’ll just work.
Seriously, the deployment story is just so good for languages that compile into a single statically-linked binary, when compared with dynamic languages.
So my threshold for “will I bother trying this non-standard tool out?” tends to be much lower for something written in Rust. I have several Rust utilities that I take the trouble of installing, and now only one non-Rust utility that I use in this fashion, git-revise (Python, and git-rebase is generally a tolerable alternative if I can’t set git-revise up).
Well then, back to my narrative. I wasn’t actually expecting it to be in Rust (though on reflection, why not?), but when I saw “cargo install broot”, I cackled aloud.
And I’ve just run `cargo install broot`.
It means the thing is lightweight and fast. And also - unlikely to crash or eat my drive because of sloppy UB.
Is this experience atypical? I've actually been running through the getting started guide for rust-lang as it left a positive impression on me. Something like this in C land seems unachievable.
Those of us who like to charge in to CLI tools all guns-blazing-like would appreciate it. Also, it would immediately communicate that the project is written in Rust, which some people may like.
Note that broot is far from new and is reliable on linux. I used it daily in the past 10 months. The only thing which prevented me from tagging it 1.0 is the rough edges on Windows.
I am not sure if you have something to do with the "brew" installer for this on MacOS? Or does someone else create that?
Anyways, looks awesome, I think I'll use this at least for listing files by size.
This could use some documentation imo. Like the essentials of what 'supported on Win10+' means (is it supported in powershell, or command prompt or bash running on msys or ... ?) and how to laucnh/install it. I only looked briefly, ran broot in cmd but the only thing I get out of broot is that it creates a file <AppData>\Roaming\dystroy\broot\data\launcher\bash\1 and a link (even when entering 'n' instead of 'Y' when it asks to install!!). So I figured it maybe needs to find a 'br' command and added a function 'br' in powershell and launched that, but it still says it's not installed.
Another developer already started to work on a `br` function for windows: https://github.com/Canop/broot/issues/78
"The easiest way to read and edit broot's configuration file is to go the help screen (using ?) then to type :open."
When I do that, I get "verb not found: "open"". Not quite sure what is supposed to happen here. I found the config file and editted it manually, but was some magic supposed to happen with the "open" verb?
Terminals have sped up, but the amount of terminal I/O to draw a screen has increased, too. Nowadays there are lengthy SGR 38/48 sequences for 24-bit RGB, plus the other SGR sequences for attributes, plus of course characters that are now commonly multi-byte UTF-8 encodings, including box drawing characters.
So the old considerations of optimizing terminal output still apply nowadays to full-screen TUI applications. Optimize out cursor motions that move to where the cursor currently is; replace absolute motions to nearby positions by shorter relative motion control sequences; optimize out superfluous attribute and colour changes; replace onwards horizontal cursor motions by just rewriting the relevant characters; skip unchanged cells; and so forth.
* https://github.com/jdebp/nosh/blob/79b1c0aab9834a09a59e15d47...
The Rust full-screen TUI code in Broot (and common Rust libraries) does not do any of this.
* https://github.com/Canop/broot/blob/d8ba179946ad10d777f93b4a...
* https://github.com/crossterm-rs/crossterm/blob/41ff73e3d3763...
When it is a Win32 application, it uses console I/O and this does not matter quite as much, although it's still a waste of system call context switches to overwrite a console screen buffer with what is already there. But when it is using terminal I/O this matters significantly.
The Rust terminal handling is actually fairly poor overall. This list, for example, is in reality a lot longer. The terminfo database records a lot more terminal types that understand these escape sequences. "putty" for one egregiously missing example.
* https://github.com/crossterm-rs/crossterm/blob/41ff73e3d3763...
* https://invisible-island.net/ncurses/terminfo.ti.html#tic-pu...
Personally, rather than treat lack of capability as the norm with a paltry list of exceptions, I prefer the opposite assumption that (except for "dumb") the world has nowadays reached 1976 capability levels. (-:
* https://github.com/jdebp/nosh/blob/79b1c0aab9834a09a59e15d47...
Overall though, great tool!
I've been told that the bash file path I use on mac is wrong though: https://github.com/Canop/broot/issues/84
source /Users/username/Library/Preferences/org.dystroy.broot/launcher/bash/br
Obviously replacing username with your username...
One of the downsides is that it calculates the space everytime with -s option which makes it slow in that mode.
If you seek for really fast tool for that purpose then try ncdu which calculates the sizes only once at start then then does that only on your request by pressing the 'r' key.
Here is how ncdu looks like:
https://linuxundich.de/wp-content/uploads/2014/12/ncdu-linux...
1. `cargo install dirstat-rs` (binary is `ds`): Prints several lines showing the size of the directory and the top fattest children. Colored output.
2. `cargo install dua-cli` (binary is `dua`): Only prints one line with the specified directory size. Colored output.
Both are insanely fast (they use all CPU cores). Love them both.
The bit that's not done yet is rendering an overlay in the web player - https://github.com/asciinema/asciinema-player/issues/79
du -h | sort -hr | lessI sometimes find it amazing that we do computer science for decades now, but there is still a lot of room to improve very basic things.
The gnu target seems to be fully static and run everywhere with no dependencies.
Anyway. This look super cool. I'm a Windows guy but have been using terminal more lately with tools like https://github.com/BurntSushi/ripgrep https://github.com/sharkdp/bat https://github.com/sharkdp/fd and they work great on Windows (plus are easily installable by https://scoop.sh/). Hope the Windows story will improve for Broot to.
Some suggestions after very quick look (except not working Shift key on Windows).
* Screen refreshing and general experience is really slow. Hold arrow key for couple of seconds and see that refreshing can't catch up. The best performance is on standard windows cmd, a bit worse on new "Windows Terminal (Preview)", absolutely horrible on ConEmu (which I use daily :-( )
* I sort of expected that I can "scroll" current directory but I get "400 unlisted" text at the bottom. It makes sense for nested directories and looks like main feature of Broot. But for _current directory_ it would be great if it didn't "trim" entries at the end and you could just use standard arrows keys, PageUp/PageDown and Home/End to quickly glance and see what files are available when I don't know what file names I'm looking for. And when I would want to do the same for some nested directory I would just select it with Enter. So basically it would be great if Broot was more like https://github.com/junegunn/fzf but not just for flat list of files.
- The backspace key quits the program. I've accidentally quit so many times after deleting my filter by holding the key down.
- The filter seems quite quick at first, but when I add a period it slows down massively. ie. Search for "xorg", then "xorg.conf", the moment you type the period it hangs for a good few seconds, even though it's in the top level of my home folder. A breadth first search should find it trivially, so I'm assuming it's some quirk of the fuzzy matching.
See https://superuser.com/a/496152 for screenshots.
* on a file it opens the file (in the same terminal if possible, depending on the system file opening) * on a directory it does a cd to that directory and comes back to the terminal (if broot was launched with the br command)
I'd like Mac users to chime in and answer you now: I can't really test on mac.
Good job btw, Broot looks awesome!
1. support vim keybindings
2. support editing text files inside the terminal as ranger does
with a quick try i still feel ranger is better, if I missed something that broot has advantages over ranger please let me know.Can it be configured to just open file in vim or other eidtor? May be in a subshell, so you can return back to broot. Why reinvent the wheel...
on the other hand, grep/find GNU tools all should be upgraded to ignore .git/node_modules/pip-site-packages by default, and honor .gitignore,etc.
Windows:
- http://textmode.netne.net/Extreme.html
Unix:
I don’t know if it’s faithful enough for you
Only dealbreaker for me unfortunately is that it forces me to use up/down arrows, i.e. leave the home row. I use ctrl+p/n everywhere (or ctrl+j/k in some tools), be it in the terminal or on macOS.
Given your workflow, you might want to give ranger a try?
Just for those who don't want to learn more ... you can get a lot of similar utility experience using:
`tmux` (for panes with mouse support) and `fish` (for autocomplete)
I prefer to handle lot of the additional function over `ls` or `tree` that is offered by `broot` in separate panes.
I just feel it is more manageable and interactive with a lot of flexibility.
thank you
"frontendaction" will match "frontendaction.txt" but not "frontend/action.txt"
"frontend/action" will turn the search into a regular expression and complain
It's quite beefy for such a tool.
but does anyone has an idea if there is a way to customise file sorting?
There's the "fat whales spotting" mode, which only displays one level and sorts by size, though, and I plan to extend this mode to other sortings.
(I made a new release)
Also: might want to fall back to .profile if .bashrc isn't found...
and I guess people more used to black-and-white could submit a better one
Also an XTree-like info panels around the tree itself would help tidying the layout and increasing info density.
All new is a well-forgotten old.
-- I am Broot
-- I am Broot
-- I am Broot
How I did it (though not using CentOS, should be identical):
Install rustup from https://rustup.rs/ (download & run the shell script).
Then `cargo install broot` to download and and install this. Then run `broot`, and restart the shell. After that it can be invoked via the `br` command.
If it's for any kind of file, then you can override the Enter: https://dystroy.org/broot/documentation/tricks/#open-files-w...
More usually you define a few shortcuts for your specific needs : https://dystroy.org/broot/documentation/configuration/#verbs...
When I put enter as a key in place of F2.
I don't care if it's been done before. I don't care if <insert name here> exists and does a similar thing.
Awesome because: - short name (br in terminal, I'll remember that instantly)
- easy installation
- web page is awesome and shows you instantly how to best use this program
- help page in the program itself is awesome, clear and easy to navigate
- defaults are sensible and totally easy to get used to
- broot just WORKS! and it works well, I finally got rid of all the aliases around ls that I used in order to get info I want
Amazing job Denys, 10/10 for the web, program, documentation and examples!
Btw. Linux/Windows user here.
Have an excellent day and successful year!
I think a vim mode would be great. The first thing I did was to use 'j' to navigate in the tree.
Vim keys is the closest console programs have to a common language! I seriously think all console programs should use a vim-like keymap. Not Emacs, because Emacs has a completely different philosophy - integrate everything into Emacs. Emacs is the prototype IDE. Emacs doesn't seek to export its keybindings, it seeks to import everything.
But without first class support for vi navigation, be will end up replacing tree as my directory preview pane in vifm.
This should teach anyone that tackling something that's considered "the basics" is not a bad idea. It is astounding how these really simple things can still be enhanced (or even revolutionised ;)) in 2020.
Can you please elaborate? Is that specifically because nnn[1] doesn't show a complete overview of the filesystem or some other features are missing?
One of the guiding principles of nnn is to generate minimum disk IOs.
Reading through a complete volume on a stuffed microSD or SD card attached to a RaspberryPi to list the filesystem (even if compacted) and then supporting filesystem changes dynamically is resource-intensive. nnn development is driven by minimum resource availability and usage.
It simplifies a lot of workflows and reduces the number of keys.
disclaimer: my definition of "devops" is sitting in a remote terminal for where I run docker and chasing down which files take up all my precious space, or not remembering where I put something, which makes the tree overview very useful. I know I could achieve this via many other means also (and did before Broot), but Broot is also very pretty, so I quite like that, too :)
#1 ask: please add a Vim mode for j/k navigation and / search.
but seriously, how to install from source is clearly shown
Especially the screenshots help to get motivated to try it and if you try it you will notice it just works as advertised - awesome :-D
then run the broot command and it will prompt you to update your .bashrc or .zshrc file
The homebrew version is quite behind though, it was 0.10.x when I checked earlier today, while the latest version is 0.11.x.
This is an awesome piece work. Do a "simple" thing extremely well! Well done
Right now the best option is to define the skin in the config file (see https://dystroy.org/broot/documentation/configuration/#white...) and I've added a new issue requesting that broot detects if a white skin seems more suitable.
There is a section in the help about using verbs on a selection, but nothing to indicate how to turn a regex search into a multiple file selection (can't tell if this is supported or not) ... I guess if it's not it would be a neat thing to see if I could add.
Edit: there is a chat room! https://miaou.dystroy.org/3490?broot