Show HN: Chawan TUI web browser

by shiomiruon 6/16/2025, 8:48 PMwith 70 comments

A terminal-based web browser in Nim.[1] Has acceptable (YMMV) CSS rendering, some JS support, and inline images (sixel/kitty). It can also use various protocols other than http(s) such as (s)ftp, gopher, gemini, ...

Chawan started out as a w3m clone, and the UI still resembles it. However, the architecture has turned out quite different, with pages loaded in separate processes, and protocol/file type handling separated out into external binaries. An interesting result is that you can even register decoders for custom inline image formats, although practical use cases of this are rather minimal.

There is a gallery showcasing some websites being rendered here: https://chawan.net/gallery/index.html

[1]: https://nim-lang.org

by eMPee584on 6/17/2025, 6:26 AM

Thanks, always appreciate ways of not using another blink engine for a brief research side quest! looking forward to test after school ; )

As it hasn't been brought up yet, a really great hack (esp. for us without sixel) is this terminal port of chromium: https://github.com/fathyb/carbonyl .. but the original creator hasn't had time to get back to it. So it is very bare bones & lacks a lot of features, like keyboard shortcuts, file saving.. but obviously it brings full web compatibility and is just very cool. Wishing for someone with rust skills to pick it up again, last time I looked (couple of months ago) none of the forks had any momentum.

by onetomon 6/17/2025, 6:31 AM

@shiomiru

What's the best resource (paid or free) in your opinion for learning about these TTY related concepts?

I'm aware of https://www.linusakesson.net/programming/tty/index.php for example, but that doesn't go into termcap/terminfo/curses.

one of the comments mentions http://www.amazon.com/termcap-terminfo-OReilly-Nutshell-Lind... though (online https://www.scribd.com/document/831486848/Termcap-and-Termin...)

by noufalibrahimon 6/17/2025, 4:56 AM

This is beautifully done. I'm going to use this for some of my daily work and see how far I can get with it. HN looks exceptionally good. Thank you!

by isaacvandoon 6/16/2025, 11:39 PM

This is super cool! Bravo. Awesome to see it written in Nim too.

When I do `cha example.com` I can't figure out how to use any of the commands (hjkl, etc). The only keys I've found that have any effect are typing numbers which show up in the bottom left. Haven't figured out how to do anything with those. Am I missing something obvious about how to use this or could this be a bug?

I built from source on MacOS Sequoia 15.5 Apple Silicon using Nim 2.24. Pages load correctly, I just can't get the commands to work. Thanks!

by FerretFredon 6/17/2025, 4:52 AM

Very nice! I compiled this from source on my Lenovo M8 4h gen running termux: I only had to install nim. It even installed nicely despite there being no "root" user.

by etaioinshrdluon 6/16/2025, 9:41 PM

I rabbit-holed a little and apparently Chrome and Safari no longer even fully pass Acid2 and Acid3?

by mariusoron 6/17/2025, 6:08 AM

I've always tried to make my websites look good in Links and now it looks like I have a new candidate.

Having support for some CSS makes it a bit more difficult, as spacing between elements is now an issue, where previously links would ignore margins and padding all together which were used to display cleaner inline list elements (for menus and such).

by higonon 6/17/2025, 4:04 AM

Long time w3m user here. Tried it and I can love it. Very nice.

Is that your design choice not having "Open URL"(Address bar) feature?

by silasdbon 6/17/2025, 1:31 AM

Wonderful! Thanks!

I see you don't use termcap/ncurses anymore. Do you perform terminal handling yourself directly?

Thanks again!

by ijustlovemathon 6/16/2025, 9:48 PM

My jaw dropped when HN loaded first try from Termux! Nice work!

by Hrun0on 6/21/2025, 8:03 PM

This is really impressive! Do you a have roadmap for upcoming or planned features?

by greenspamon 6/16/2025, 10:53 PM

Finally a good tool to view HN in terminal. Thank you! Where can I find the keyboard shortcuts? I can move with vim key binding, but can go back.

by poulpy123on 6/17/2025, 9:08 AM

always nice to see something written in nim. In my very novice eyes, it is the most interesting language that is situated between C/C++ and python. It's a pity it never took off. The productivity of its users compared to the userbase size always made me think I'm right even if I'm far to be knowledgeable enough on the topic

by anta40on 6/17/2025, 7:15 AM

Can be easily built on macOS with just a single 'make'. Cool.

And nice to see there's a new elinks alternative.

by desireco42on 6/17/2025, 5:11 AM

I think making markdown browser would totally make sense for terminal and would work really well. Come to think about it, you can even, Netscape style even allow editing of the pages. Now that would be something.

Nim is wonderful language and I am glad to see it used for this.

by zquestzon 6/17/2025, 3:31 AM

This works great, been playing with it through s-search and it works way better than w3m. =)

by elcritchon 6/16/2025, 11:14 PM

I recommend perusing the code. Since it’s in Nim it’s pretty approachable (and performant). There’s still lots of gnarly bits like implementing HTML DOM and web specs, but it doesn’t take you days to grasp the basic setup.

by mikeponderson 6/16/2025, 10:57 PM

Gotta love Nim

by corvon 6/16/2025, 9:54 PM

Awesome and in Nim!

by hecanjogon 6/16/2025, 9:10 PM

I love this browser, thank you for building it!

by ieee2on 6/17/2025, 11:13 AM

How are those images rendered in text UI?

by marcodiegoon 6/16/2025, 9:35 PM

GPM support?

by lucideeron 6/17/2025, 12:21 AM

Absolutely incredible. And it even supports gopher.

by adamseddieon 6/17/2025, 10:38 AM

Dockerfile: https://paste.rs/egbGg

docker build -t chawan:0.2.0 .

docker run -it --rm chawan:0.2.0 https://news.ycombinator.com/

by ericrenanon 6/17/2025, 4:14 PM

Good job,really nice work,congrats.

by agumonkeyon 6/16/2025, 10:45 PM

as a tiny web fan, it's lovely to see projects like these, *claps*

by avinasshon 6/17/2025, 9:50 AM

what does the name mean

by gherard5555on 6/17/2025, 1:31 PM

Can we talk about how refreshing this web design is