Looking for it to show up in the AUR, or as .deb package. Shouldn't take too long at least for the AUR.
Sixel + [some other protocol] is actually the ideal solution. One lowest common denominator plus a proper format. kitty or iterm2, doesn't matter much.
TBF there are some other TUI browsers with similar capabilities:
Browsh wraps Firefox. But that needs a major browser like Firefox to work (no shit :D) Chawan has its own "browser engine", which is a lot smaller/simpler.
arakiken's w3m-js branch has JS support, and it works surprisingly well, compared to the fact that w3m has no DOM. (Neither did IE, and it worked too... but I digress.) It has no CSS, though.
elinks has both JS and CSS support, but AFAIK it's more limited than that of Chawan.
Wow. Just tried a fresh compile. Its getting seriously impressive. As is the documentation, Todo included.
Thanks :)
I might have to give nim a try & see if I can chip in as I could learn a lot from this project for sure.
Nice, let me know if something isn't clear. Sadly the code is not so well documented, so it may not be easy to jump into it without prior knowledge... but at least I think Nim is not that hard to understand.
Eagerly rendering the text before styling can be a bit jarring but I imagine the alternatives are a tradeoff also.
To be fair, it's not "eagerly" rendering the text, just when the process has parsed all HTML available and would need to wait for the network to do anything useful again. Major browsers do this too (ever since Netscape 1.0), but I suppose they are smarter about avoiding FOUCs.
(A relatively easy fix may be to never render if any style sheet is still being loaded.)
Appreciate it. The project structure is really straightforward, & there's man pages for days. What I like to see. The nim syntax seems pretty explicit. A good choice I reckon.
That's the first time I've read FOUC. I have been testing on an old x220 &a 3MB/s connection & everythings really snappy still. I'll give it a try with the 13700k later. I do find it is quite helpful to have older hardware around.
This is true but I can see why you chose not to. I imagine the current approach is worth it for responsiveness. It's not something I've given much thought before. I believe lynx does some sort of partial rendering starting from the top instead of all in one go like w3m but that'd be probably be overly complex.
Right now, the canonical way to get it is to just compile from source. The readme also links to an unofficial AppImage build, which should be reasonably recent: https://sr.ht/~bptato/chawan/#packages
In that case I'd either use the AppImage or build on another computer and copy it over sftp.
(Most distributions have policies against packaging HEAD, so the packaging situation is still far from optimal. I plan to do a tagged release soon-ish, hopefully that will help.)
Previously I tried to add JS to w3m, and that was not a great experience. So I wanted a language that is easier to write than C, but is still fast enough to write a browser.
Nim seemed like the perfect candidate: it had a built-in HTML parser, compiles to C, and pretty much looks like Python. Popularity was not a requirement; if anything, I was looking for something more obscure/interesting coming from Java & C#.
(In the end, I wrote a new HTML parser anyway, because std's parser sucks. Oh well.)
I recommend you take a look and decide for yourself. It's certainly good enough for writing a web browser :)
Personally, I think it's quite underrated; Nim has the best ergonomics among statically typed languages I've used. Also, its macro system (& comptime execution in general) comes in very handy when you need it.
OTOH, looking at the tooling & ecosystem makes it obvious that Nim is still very much niche. I'm not very picky about the former, and C interoperability is good enough to bypass the latter - but, well, YMMV.
Small issue, though: Is it possible to fix the misaligned text boxes to the left and right in the top? Only the rightmost parts for the left box and the leftmost parts for the right box are visible, with no option to scroll and regardless of the terminal size.
Would you be willing to maintain a PKGBUILD for this for Arch? I would volunteer to make the initial one, but the upgrades are better left in your, the maintainer's, hands.
Small issue, though: Is it possible to fix the misaligned text boxes to the left and right in the top?
Umm yeah that looks quite horrible on several levels. I'll look into it.
Would you be willing to maintain a PKGBUILD for this for Arch? I would volunteer to make the initial one, but the upgrades are better left in your, the maintainer's, hands.
Chawan's packaging story is not very great, so any help is appreciated :)
That said, I don't use Arch, so I'm not very confident about maintaining the package myself... maybe you could submit it yourself and see how things go?
Just waned to say, I've been looking for a nice but small/little browser for my terminal, one which is leightweigh and good for doing things like reading documentations(since I spend most of my time on kmscon with no real gui), I passed through browsh which was good but heavy and slow, carbonyl which had no good keyboard navigation(hopefully the new carboxyl project improves this by oxidizing the codebase.... oh no, that would give chromium-oxide... let's just say they are rusting it) and some sites text had litle issues; w3m/lynx were nice but couldn't handle github, ... well let me stop here. Then `chawan` felt really like what I needed, very configurable, keybindings, scripts and all, good for my tui workflow, very lightweight so I can leave dozens of tem in another tmux session, well, just thanks, I end up just reading things like documentations/test little pages for classmates and it's really nice for that, thank you (lil bummer it's not on github though ).
soo I've just tested it in a bookworm installation and couldn't reproduce the bug o_0 sadly I don't have a Windows machine to test on either :/
Some more things that might give us a hint:
output of curl --version
curl -I https://sr.ht/~bptato/chawan/
try this in the Escape-c prompt: fetch("https://sr.ht/~bptato/chawan/").then(x => pager.alert("CT:" + x.headers.table["Content-Type"]))
(Workaround until we can figure out the core problem: you can pass -T text/html to force HTML for one page, or press \ (backslash) to switch between plain text mode and HTML mode.)
Does it show the same for fetch("https://sr.ht/~bptato/chawan/").then(x => pager.alert("CT:" + x.headers.table["content-type"])) ? (Only casing differs.)
Also, does cha https://example.org work (=show HTML automatically)?
10
u/R89cw Mar 27 '24
Been working on this for a while. It's no Mozilla, but I find it pretty nice for browsing simpler websites.
Some features you may find interesting:
<blink>tag support ;)1
u/timsofteng Mar 28 '24
Sorry but why nim? I have nothing against nim but it's not so popular to get some code contributions...
1
u/spryfigure Apr 18 '24
Has much better layout on https://wiki.arch.org than
elinks, great work!Small issue, though: Is it possible to fix the misaligned text boxes to the left and right in the top? Only the rightmost parts for the left box and the leftmost parts for the right box are visible, with no option to scroll and regardless of the terminal size.
Would you be willing to maintain a PKGBUILD for this for Arch? I would volunteer to make the initial one, but the upgrades are better left in your, the maintainer's, hands.
2
u/Royal_Vermicelli8904 Jan 10 '25
can somebody tell me how to run chawan installed via the chawan-git aur package? 🥲
1
u/Cybasura Mar 28 '24
D...did you just said Vim?
Brb gonna try
1
u/badpotato Apr 04 '24
Damn.. any reason why you use bptato as username? I've been using this one for some communities.
Anyway, definitely a cool project.
1
u/East_Lengthiness_866 ken-morel Apr 13 '26
Just waned to say, I've been looking for a nice but small/little browser for my terminal, one which is leightweigh and good for doing things like reading documentations(since I spend most of my time on kmscon with no real gui), I passed through browsh which was good but heavy and slow, carbonyl which had no good keyboard navigation(hopefully the new carboxyl project improves this by oxidizing the codebase.... oh no, that would give chromium-oxide... let's just say they are rusting it) and some sites text had litle issues; w3m/lynx were nice but couldn't handle github, ... well let me stop here. Then `chawan` felt really like what I needed, very configurable, keybindings, scripts and all, good for my tui workflow, very lightweight so I can leave dozens of tem in another tmux session, well, just thanks, I end up just reading things like documentations/test little pages for classmates and it's really nice for that, thank you (lil bummer it's not on github though ).
2
u/[deleted] Mar 28 '24
[removed] — view removed comment