1182 points · by fathyb · 3y ago · 122 comments
http://github.com/csdvrx/sixel-tmux
For example with Windows Terminal: https://raw.githubusercontent.com/csdvrx/sixel-tmux/main/exa...
OP, if you want to keep your current solution, check how going beyond unicode halfblocks can help: https://github.com/csdvrx/derasterize
In a way, using sixel-tmux is like "giving magical goggles" to your terminal, to let it render sixels so you can see something (even if it isn't perfect), in the hope you'll be tempted to use a better terminal that will show you sixels in all their glory, with a pixel perfect quality.
Sixels enable all kind of cool things, like gnuplot right in your terminal (cf https://github.com/csdvrx/sixel-gnuplot ): sometimes I even watch youtube on my terminal lol
sixel-tmux was made as a first step towards turning derasterize into a more general library: my plan was to add it to nnn but I got bored along the way and moved to other stuff. I might still do that I I love nnn as a filemanager.
BTW, even if there have been quite a few interesting work by @hpa and others in the last 2 years, I think derasterize still has textmode supremacy. derasterize is a collab with @jart after I started adding features to her previous solutions which was based on half blocks like this solution; she's also made further work based on this like https://justine.lol/printimage.html and https://justine.lol/printvideo.html
I only had a vague memory it was huge, expensive and got very warm but in the 1980s there weren't any graphics like it, most high tech for the time.
This project, on the other hand, allows me to "watch" Youtube videos across a fairly slow SSH connection on a remote host on the other side of NA, and "smoothly" scroll around, looking through comments and the like.
Comparing them side by side, it seems like brow.sh is a bit more precise (re: layout), but carbonyl is much more responsive. Very impressive. Not sure if there's a use for watching Unicode youtube videos in the terminal, but impressive!
*Issue is Chrome doesn't support extensions in headless mode.
`xvfb-run --server-args="-screen 0 1920x1080x24" google-chrome --remote-debugging-port=9222 --disable-gpu http://example.org`
This seems like an automation dream for all kinds of things when I want to see browser interactions and results - but all from a terminal! This is awesome.
Even better: https://en.wikipedia.org/wiki/Sixel Doesn't support 24-bit color though.
I’m still exploring it thought, but as a separate program to run any X apps through SSH.
https://github.com/chrhasse/alacritty-sixel
It is crazyfast. Alacritty will merge it someday, but they have very very high standards and allowing graphics is a major change. So it's taking a lot of time.Try mintty (from msys2), xterm or mlterm (multiplatform)
https://github.com/blitzcode/term-gfx/blob/master/src/main.r...
You're still just getting two colors per character, but I think it works quite nicely.
I really don't want to see this to fall behind upstream in terms of performance and security fixes.
From the author's Github repo:
# Watch YouTube inside a Docker container
$ docker run -ti fathyb/carbonyl https://youtube.com
Have you had problems with this triggering bot/scraper/abuse-detection?
You force-enable `kContentCapture`, `kContentCaptureTriggeringForExperiment`, and `kContentCaptureInWebLayer`, which make the browser look -- to the website -- a LOT like a bot/scraper and not at all like a normal user.
Something that could be cool is work with them/submit patches to improve the DevTools protocol to be more efficient and suited for Carbonyl and html2svg's use-case. Combined with a virtual X server (in Rust of course!), this could provide very similar performance and remove the need to fork.
For the bot-detection, I only had Twitter telling me the browser is not compatible so far, it was caused by the "Carbonyl (version)" user-agent. I fixed it by switching to "Chromium (version) / Carbonyl".
Good point on kContentCapture, I didn't realize it could be visible to websites. I enabled it to experiment with new ways to get text data, but ended falling back on Skia. I'm going to disable it now that it's unused!
The fork here goes even further, which is really cool.
The fork here goes incomparably further. Libcaca just produces an ‘ASCII art’ approximation of an image, not capable of handling text. So, while the photo is too small to see it, the text on the terminal is gibberish. The libcaca backend was done as an backend interoperability exercise, and run on a real terminal just for fun.
docker run -ti fathyb/carbonyl https://vscode.dev/ docker run -ti fathyb/carbonyl https://github1s.com/fathyb/carbonylBut it is close enough that with some work it could.
This is truly very impressive.
This is actually the showstopper for me with any kind of terminal browser. I enjoyed playing with browsh (or what was it called?) a few years ago, but this is much better.
I wonder if my suggested workaround has any meat to it.
"Forking Chrome to turn HTML into SVG" https://news.ycombinator.com/item?id=33584941 (471 points | 75 days ago | 97 comments)
It'd be fun to build a pure CLI-based OS around this. Imagine opening apps by running `/www/github.com`
> The inline images such as the world/book icon and the CERN icon, would have been displayed in separate windows, as it didn't at first do inline images.
Historically, DPS is one of the reasons Safari PDF exports look so good: Apple based CoreGraphics APIs on DPS to make the migration from NeXTStep to Mac OS easy. This makes the CoreGraphics<->PS/PDF conversion fairly straightforward.
[0]: https://www.w3.org/People/Berners-Lee/WorldWideWeb.html
[1]: https://developer.apple.com/documentation/appkit/nstext
There are some escape sequences you can feed to some terminals, though, that emit graphics. "Sixels" are pretty well known for pushing graphics to a terminal, but they're not universally supported.
iTerm2, on macOS, has a means of escaping and then sending a PNG, which is then displayed, IIRC. (But it's unique to iTerm2, and IIRC iTerm2 identifies as an xterm so it's basically impossible to autodetect.)
Start your xterm with the right flags and it will.
If you want a premade configuration, see https://github.com/csdvrx/CuteXterm
kitty + w3m is getting there as well.
But seriously, why not using browsers like lynx and links?
Am I missing something?
Just a consequence of turning a markup language into an OS.
Edbrowse uses it and it has enough JS support to even login and comment against JS ridden sites.
Browser, email, irc, SQL client, file manager and editor for the blind with an ed philosophy.
TFA doesn't seem to refer to electron at all. What's the connection here?
I good start: re-use the parsers from netsurf, get mr Bellard and friends quickJS... and then the ez part: get 748392749324732984 full-time devs full for 748937489234 centuries in order to get such engine working... BUT it is not finish since, once "working", you will have to play catch up with blackrock/vanguard financed web engines and everything they will do to break compat with your engine.
Some ppl are still trying with rust? servo something?
Thatcher is by design and I guess Google is mainly to blame by now.
Oh, and those ppl own and steer microsoft too, and some wonder why those are using blink now. I do ask myself how long they will keep webkit and blink since they have already geeko to feint the anti-trust laws.
But your are right, they made the "Standard" so insanely complex on top of the core noscript/basic (x)html, that it "works" only in their implementations with their armies of devs.
This is accutely toxic for humanity. The only "real" ways out of this: restore noscript/basic (x)html where it is still doing a good enough job, and if a "new" web has to be born: an implemention must be something reasonable in time/skills and efforts for a small team of devs.
Their code is plain and simple C, namely their libs (because they did things cleanly), can be used as a stepping stone to write your own noscript browser, and if you want with CSS rendering.
Regarding the javascript-ed web, if you have 7483947398 devs for 479837438 centuries, and are able to sustain the permanent planned obsolescence and breakage of the web "standard", that for forever, you may have a chance to provide a real alternative implementation, namely not dependent on their SDK, so using a language simple enough like plain and simple C and certainly not c++/java and similar. Some are trying (still?) with rust (orders of magnitude cheaper than c++).
Don't forget, blink/geeko/webkit are financed by the blackrock/vanguard galaxy of owned companies ("big tech"), we are talking tens of thousands of billions of $, namely you must be "outside" the economy to have a chance, and don't worry, if you start to have something interesting (and that without using their SDK), they'll make your life rough (they will break their web sites/javascript on your implementation actively, "buy" your devs, try to torpedo your financing, etc).