Every time I see a project using icon font sets (this particular project recommends Nerd Font [1]), I feel something is very wrong. We already have a sort of way (or two) to represent an image in the terminal, but icon fonts are a different beast because it essentially supports a vector representation. Code point collision is already happening (Nerd Font is already coping with this [2]), and in a long run this seems unsustainable. So... is there any way or proposal to encode a vector image in the terminal? (And no, iTerm doesn't seem to support SVG in its inline image support [3].)
Unfortunately, the Unix terminal is a gigantic pile of hacks accumulated since the late 1960s. It's a miracle the software stack manages to stay upright at all; adding features and getting the entire ecosystem to support them would be tough. Introducing the concept of an external resource that has to be fetched doesn't seem impossible to me, but there are a lot of issues that would have to be thought through.
Anyway, one nice thing about TrueType/OpenType fonts is that the vector representation is extremely well compressed. SVG or similar would be an efficiency loss. In this light, fonts are actually a fairly decent and practical way to represent vector symbols that will be cached and reused. Maybe a minimal practical solution might be to add an ANSI extension that requests an appropriate font for a particular area of the screen, perhaps with a URL from which a specific webfont can be fetched.
We have some standardized emoji like . Seems like the partial 2019 solution would be to use emoji that should work in any modern font (you could make a more UNIXy-feeling font if you want everything to look less skeuomorphic and more stripped-down). This doesn't cover every programming-specific use case, but it's a nice compromise I haven't seen mentioned here.
> So... is there any way or proposal to encode a vector image in the terminal?
For raster images there are sixels, and for vector there are the tektronix codes. These are standard in xterm since forever.
Of course, they could be modernized, using real raster pixels and something like a subset of svg. I guess before standarization it would be better to have a reference implementation included in a major standard terminal.
Personally I always found using icons as defeating the whole point of using a terminal; One of the primary reasons I prefer terminal UIs over GUIs is that I don't have to decipher a bunch of strange hieroglyphs.
Even though of course nothing beats the power of a set of standardized and ubiquitous tools that you can always count on whenever you find yourself on a new machine, I must admit that I'm favorably inclined toward this trend (or what I perceive as one) of rewriting classic CLI tools with sometimes radical performance improvement promises, but most importantly (for me at least) better UIs: `grep` has always been acceptable for me, but I prefer `ag` these days, and I recently discovered `fd`, which seems like it will replace `find`, as I could never remember its weird syntax, even for the most basic cases.
One major showstopper I have with this utility is that it doesn't obey my terminal color scheme and instead hardcodes some colors that probably just look good on author's terminal. [1]
Would love to see this resolved, cause it seems rather nice otherwise.
This project becomes pretty ridiculous when you realize you can already accomplish the same features with regular ls, if you just bother to read a bit. That means the target audience for this is very junior engineers.
This has been my experience with the majority of shell toys and dev ecosystem tools that have come out in the past 20+ years; if people simply knew Unix better, they'd be able to do them all with the same tools that have been around since the 80s/early-90s. There's nothing wrong with coming up with these alternatives, but they are almost universally minor improvements over what's available by simply becoming better at Unix.
This is pretty and all, and there's nothing wrong with it, but...why? Do people run ls enough that they need something more than a plain ASCII list of filenames? Are peoples' directories so disorganized that this adds enough value to justify it over /bin/ls?
I probably run ls a few dozen times a day, but it's usually just to answer "what did I call that file again?" or "did I remember to copy that over?"
I can't imagine a scenario where I'd require too many extra visual cues. I use color ls, mostly because I find the optional symbols like '/' to be distracting, and differentiating files and directories via color is about all I care about.
There's overhead in becoming too attached to non-standard tools: you have to go out of your way to install them, your muscle memory needs retraining, etc.
Most importantly, tools like this break a bunch of core command line standards, like doing one thing and doing it well, and producing clean output that can be pipeline-filtered with all the other Unix standards.
One need only consider that Orthodox File Managers have been in existence for decades to realize that yes indeed people do like to work with more than plain lists of filenames.
Playing the "doing one thing" card when it comes to ls is rather risky, as ls, with its options for doing things like sorting its output, is one of the favourite examples that people point to of tools that do not adhere to this philosophy in practice.
I think its worth mentioning that rust has the gold standard argument parsing library now:
https://clap.rs
That library is used by most(?) rust cli tools, so they all have a similar feel. In addition, there is a library built on top of clap called struct-opt that makes bringing up a new cli exceedingly easy:
https://docs.rs/structopt/0.2.15/structopt/
Seriously, checkout struct-opts page even if you don't know any rust. I think their demonstration on the front page summarizes a lot of things I like about idiomatic rust.
I'd say Rust is a productive language for providing competitive CLIs.
- Compiled so easy to distribute compared to Python, JS, etc
- Cargo makes it easy to pull in libraries compared to C/C++
- Smart people made some great libraries that make it trivial to get performance and/or a nice UX. e.g. Everything in ripgrep is available for reuse, down to how it walks the filesystem.
wow this is amazing... I love the file icons and it's beautiful... ls --tree ran almost instantly on a laravel folder which has a huge number of packages....
[+] [-] lifthrasiir|6 years ago|reply
[1] https://github.com/ryanoasis/nerd-fonts
[2] https://github.com/ryanoasis/nerd-fonts/wiki/Codepoint-Confl...
[3] https://www.iterm2.com/documentation-images.html
[+] [-] pcwalton|6 years ago|reply
Anyway, one nice thing about TrueType/OpenType fonts is that the vector representation is extremely well compressed. SVG or similar would be an efficiency loss. In this light, fonts are actually a fairly decent and practical way to represent vector symbols that will be cached and reused. Maybe a minimal practical solution might be to add an ANSI extension that requests an appropriate font for a particular area of the screen, perhaps with a URL from which a specific webfont can be fetched.
[+] [-] albertzeyer|6 years ago|reply
The only more or less widely used solutions are iTerms image support (PNG images, no vector), or Sixel (xterm and some other exotic ones).
There is also ReGIS (https://en.wikipedia.org/wiki/ReGIS), which is a vector format, which might be supported by xterm (not sure).
[+] [-] stefco_|6 years ago|reply
[+] [-] enriquto|6 years ago|reply
For raster images there are sixels, and for vector there are the tektronix codes. These are standard in xterm since forever.
Of course, they could be modernized, using real raster pixels and something like a subset of svg. I guess before standarization it would be better to have a reference implementation included in a major standard terminal.
[+] [-] Tepix|6 years ago|reply
A standard xterm supports vt340 if you start it with the option "-ti vt340" which supports ReGIS as well.
[1] http://41j.com/hterm/
[+] [-] darkpuma|6 years ago|reply
[+] [-] knolax|6 years ago|reply
[+] [-] cjauvin|6 years ago|reply
[+] [-] rlue|6 years ago|reply
https://github.com/BurntSushi/ripgrep
[+] [-] crowbahr|6 years ago|reply
Now I feel like all my hard earned cli-fu is a lie.
[+] [-] chmln|6 years ago|reply
[+] [-] GolDDranks|6 years ago|reply
[+] [-] JoshuaRLi|6 years ago|reply
[+] [-] chmln|6 years ago|reply
Would love to see this resolved, cause it seems rather nice otherwise.
https://github.com/Peltoche/lsd/issues/90
[+] [-] xwdv|6 years ago|reply
[+] [-] caymanjim|6 years ago|reply
[+] [-] tambourine_man|6 years ago|reply
So please drop the dismissive patronizing tone.
[+] [-] estomagordo|6 years ago|reply
[+] [-] caymanjim|6 years ago|reply
I probably run ls a few dozen times a day, but it's usually just to answer "what did I call that file again?" or "did I remember to copy that over?"
I can't imagine a scenario where I'd require too many extra visual cues. I use color ls, mostly because I find the optional symbols like '/' to be distracting, and differentiating files and directories via color is about all I care about.
There's overhead in becoming too attached to non-standard tools: you have to go out of your way to install them, your muscle memory needs retraining, etc.
Most importantly, tools like this break a bunch of core command line standards, like doing one thing and doing it well, and producing clean output that can be pipeline-filtered with all the other Unix standards.
[+] [-] JdeBP|6 years ago|reply
Playing the "doing one thing" card when it comes to ls is rather risky, as ls, with its options for doing things like sorting its output, is one of the favourite examples that people point to of tools that do not adhere to this philosophy in practice.
* https://news.ycombinator.com/item?id=4023265
* https://news.ycombinator.com/item?id=9673975
* https://news.ycombinator.com/item?id=8484718
... and so on.
[+] [-] anderspitman|6 years ago|reply
[+] [-] ac29|6 years ago|reply
https://github.com/agarrharr/awesome-cli-apps
[+] [-] h1d|6 years ago|reply
https://github.com/alebcay/awesome-shell
Only for rust but not a bad list I think.
https://lib.rs/command-line-utilities
Some blog post introducing cli tools.
https://darrenburns.net/posts/tools/
[+] [-] nikeee|6 years ago|reply
https://the.exa.website
[+] [-] hyh1048576|6 years ago|reply
[+] [-] gnulinux|6 years ago|reply
1. People predict Rust will be more popular in the future, so they're trying to learn/master the language by practicing it.
2. People think speed and memory safety are important guarantees for unix programs.
3. People are testing whether Rust deserves the fame it has
[+] [-] ThemalSpan|6 years ago|reply
That library is used by most(?) rust cli tools, so they all have a similar feel. In addition, there is a library built on top of clap called struct-opt that makes bringing up a new cli exceedingly easy: https://docs.rs/structopt/0.2.15/structopt/
Seriously, checkout struct-opts page even if you don't know any rust. I think their demonstration on the front page summarizes a lot of things I like about idiomatic rust.
[+] [-] epage|6 years ago|reply
- Compiled so easy to distribute compared to Python, JS, etc - Cargo makes it easy to pull in libraries compared to C/C++ - Smart people made some great libraries that make it trivial to get performance and/or a nice UX. e.g. Everything in ripgrep is available for reuse, down to how it walks the filesystem.
[+] [-] estomagordo|6 years ago|reply
[+] [-] empath75|6 years ago|reply
[+] [-] crystaln|6 years ago|reply
[+] [-] tambourine_man|6 years ago|reply
It’s also a lot faster, according to the benchmarks.
[+] [-] ksherlock|6 years ago|reply
[+] [-] gremlinsinc|6 years ago|reply
[+] [-] jenhsun|6 years ago|reply
A modern replacement for ls, written in Rust. https://the.exa.website/
ls with coloring and icons https://github.com/Electrux/ls_extended
[+] [-] lucasmullens|6 years ago|reply
[+] [-] sridca|6 years ago|reply
[+] [-] jasonhansel|6 years ago|reply
[+] [-] fao_|6 years ago|reply
[+] [-] thatguy1|6 years ago|reply
[+] [-] fouc|6 years ago|reply
[+] [-] reddotX|6 years ago|reply
[+] [-] superconformist|6 years ago|reply
However it's written in our lord and savior RUST and has lots of colors so this shit is definitely "next gen."
0: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls...
[+] [-] dang|6 years ago|reply
[+] [-] saagarjha|6 years ago|reply
[+] [-] hermanradtke|6 years ago|reply
[+] [-] shaklee3|6 years ago|reply
[+] [-] echelon|6 years ago|reply
So you're using this as an opportunity to bash an entire language ecosystem? The merits of this project have no bearing on Rust or its adoption.
[+] [-] mkgolden|6 years ago|reply