chawan has a custom terminal module, so my knowledge about the standard X/Open curses is not that great.
That said, for the actual escape sequences, XTerm's ctlseqs.ms[1] is an invaluable resource. I also took many ideas from nick black's notcurses[2], and I especially recommend his notes on "sprixels".[3]
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.
tra3 5 hours ago [-]
Love it!
Slightly off topic but I’d love to see a list of mainly text sites.
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.
noufalibrahim 6 hours ago [-]
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!
poulpy123 2 hours ago [-]
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
isaacvando 11 hours ago [-]
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!
isaacvando 11 hours ago [-]
I tried it in Ghostty, iTerm2, and Terminal.app and they all behaved the same.
Could you please pull the macos-input branch from
https://git.sr.ht/~bptato/chawan and report back on what the `a` file
includes after opening a site and typing some commands?
(Should be created in the current working directory.)
isaacvando 10 hours ago [-]
Here's the contents of a. Let me know if there are any other commands you'd like me to type.
```
handleCommandInput 1, buffer "" c 'j'
handleCommandInput 2, buffer "" c 'j'
after handleCommandInput, buffer 0x104c5b780"j" c 'j'
handleCommandInput 1, buffer "" c 'k'
handleCommandInput 2, buffer "" c 'k'
after handleCommandInput, buffer 0x104ca8b70"k" c 'k'
handleCommandInput 1, buffer "" c 'l'
handleCommandInput 2, buffer "" c 'l'
after handleCommandInput, buffer 0x104c5bab0"l" c 'l'
handleCommandInput 1, buffer "" c 'k'
handleCommandInput 2, buffer "" c 'k'
after handleCommandInput, buffer 0x104ca8d20"k" c 'k'
handleCommandInput 1, buffer "" c 'j'
handleCommandInput 2, buffer "" c 'j'
after handleCommandInput, buffer 0x104c5b480"j" c 'j'
handleCommandInput 1, buffer "" c 'h'
handleCommandInput 2, buffer "" c 'h'
after handleCommandInput, buffer 0x104ca89c0"h" c 'h'
handleCommandInput 1, buffer "" c 'g'
handleCommandInput 2, buffer "" c 'g'
after handleCommandInput, buffer 0x104cae780"g" c 'g'
handleCommandInput 1, buffer "" c '1'
after handleCommandInput, buffer "" c '1'
handleCommandInput 1, buffer "" c '2'
after handleCommandInput, buffer "" c '2'
handleCommandInput 1, buffer "" c '3'
after handleCommandInput, buffer "" c '3'
handleCommandInput 1, buffer "" c '1'
after handleCommandInput, buffer "" c '1'
handleCommandInput 1, buffer "" c '2'
after handleCommandInput, buffer "" c '2'
handleCommandInput 1, buffer "" c '2'
after handleCommandInput, buffer "" c '2'
handleCommandInput 1, buffer "" c '3'
after handleCommandInput, buffer "" c '3'
handleCommandInput 1, buffer "" c '\3'
handleCommandInput 2, buffer "" c '\3'
after handleCommandInput, buffer 0x104cae690"\3" c '\3'
handleCommandInput 1, buffer "" c '\3'
handleCommandInput 2, buffer "" c '\3'
after handleCommandInput, buffer 0x104adaed0"\3" c '\3'
handleCommandInput 1, buffer "" c '\3'
handleCommandInput 2, buffer "" c '\3'
after handleCommandInput, buffer 0x104ca8720"\3" c '\3'
handleCommandInput 1, buffer "" c '\4'
handleCommandInput 2, buffer "" c '\4'
after handleCommandInput, buffer 0x104bf8d80"\4" c '\4'
handleCommandInput 1, buffer "" c '\3'
handleCommandInput 2, buffer "" c '\3'
after handleCommandInput, buffer 0x104caaa80"\3" c '\3'
handleCommandInput 1, buffer "" c '\4'
handleCommandInput 2, buffer "" c '\4'
after handleCommandInput, buffer 0x104ca8e40"\4" c '\4'
```
shiomiru 9 hours ago [-]
Strange, so it sees your input but still doesn't evaluate the commands...
OK, let's try something else. On master, is anything written to the status line if you press `p` when started with
cha -o'page.p="pager.alert(config.page.j)"' -V
mariusor 5 hours ago [-]
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).
shiomiru 2 hours ago [-]
The intention is that it should "just work"... I'm aware sometimes it doesn't, you can consider that a bug :)
I see you don't use termcap/ncurses anymore. Do you perform terminal handling yourself directly?
Thanks again!
shiomiru 9 hours ago [-]
Chawan never really used ncurses, only termcap. (ncurses just happens to implement termcap too.)
I started with termcap because I was already familiar with it through
w3m. But termcap is an obsolete interface, and cannot describe the only
useful attribute for modern terminals (true color). Its only benefit
was "maybe it accidentally works on a hardware terminal from the 80s",
which is cool but not really worth the extra failure mode.
So instead of migrating to terminfo, I ditched it completely in favor of
terminal queries (which were already necessary for other reasons).
There is still a built-in terminal database, to detect known TERM values
with XTerm incompatibilities. But a terminal that correctly responds to
queries will work out of the box, even if its TERM value is unknown.
higon 7 hours ago [-]
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?
shiomiru 2 hours ago [-]
The address bar should open by pressing C-l (control + L).
anta40 4 hours ago [-]
Can be easily built on macOS with just a single 'make'. Cool.
And nice to see there's a new elinks alternative.
hecanjog 14 hours ago [-]
I love this browser, thank you for building it!
shiomiru 13 hours ago [-]
Glad you like it :)
zquestz 7 hours ago [-]
This works great, been playing with it through s-search and it works way better than w3m. =)
ijustlovemath 13 hours ago [-]
My jaw dropped when HN loaded first try from Termux! Nice work!
For navigation in particular you'd use capital D to discard the current buffer
and return to the previous page. There's also , (comma, back) and
. (period, forward), which non-destructively cycle through the stack.
(Well, it's really a tree, but the UI mostly treats it as a stack.)
greenspam 11 hours ago [-]
Thank you so much!
avinassh 1 hours ago [-]
what does the name mean
meepmorp 54 minutes ago [-]
I believe it's a chinese tea bowl,
etaioinshrdlu 13 hours ago [-]
I rabbit-holed a little and apparently Chrome and Safari no longer even fully pass Acid2 and Acid3?
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.
mikeponders 12 hours ago [-]
Gotta love Nim
corv 13 hours ago [-]
Awesome and in Nim!
marcodiego 13 hours ago [-]
GPM support?
shiomiru 13 hours ago [-]
No GPM yet, but it does recognize XTerm's mouse protocol.
13 hours ago [-]
lucideer 10 hours ago [-]
Absolutely incredible. And it even supports gopher.
desireco42 6 hours ago [-]
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.
agumonkey 12 hours ago [-]
as a tiny web fan, it's lovely to see projects like these, *claps*
adamseddie 13 minutes ago [-]
[dead]
b0a04gl 5 hours ago [-]
terminal browsers are hobby projects because no one's cracked input handling, rendering consistency, and real world JS compat in a clean stack. chawan looks nice, but using external binaries for protocols feels like sidestepping the real engineering. also still tied to niche image formats like sixel/kitty which barely anyone supports. it's a cool demo, yeah, but if your terminal isn't tuned right or you're on mac, you're still wrestling with keybinds and broken visuals. this isn't ready for real usage outside the dev echo chamber
shiomiru 2 hours ago [-]
> terminal browsers are hobby projects because
...those pesky GUI users want pixel-precision :P
Surely it's a hobby project. You have to have very specific tastes to browse in the terminal in 2025.
> using external binaries for protocols feels like sidestepping the real engineering
You could easily move all protocols to the main binary. The reason for the current arrangement is that this way, you can e.g. replace the HTTP handler with curl-impersonate, or add custom protocols like magnet (etc.) See the bonus directory in the sources for inspiration.
> tied to niche image formats like sixel/kitty which barely anyone supports.
Sixel & Kitty are the only image formats anybody supports. The alternatives are ASCII art (fun, but too pixelated) & hacking images onto the terminal thru the display server (is that still a terminal-based app?) But I'm happy to discuss further, I find the issue fascinating :)
> mac
The macOS issue is largely a function of the only person working on this not having a mac. If you do, you can help solving it by debugging it yourself & posting the results: https://todo.sr.ht/~bptato/chawan/63
akkartik 5 hours ago [-]
Nobody thinks it is. Please see yourself out, your visa to the dev echo chamber has been revoked :)
b0a04gl 4 hours ago [-]
fair, but that's exactly the problem. we keep building tooling that never leaves the echo chamber and then pat each other on the back for novelty. i'm not gatekeeping here .just pointing out that unless someone actually solves the hard bits (input stack, rendering, js), these stay as niche dev toys. i'd rather call it out early than pretend it's production‑viable when the fundamentals aren't nailed. not hating. just tired of shipping half-stacks we can’t rely on.
akkartik 4 hours ago [-]
This is a Show HN! By hackers for hackers! Not everything has to be serious and ambitous and schleppy.
I can totally relate with your frustration. Here, come criticize my half-stack instead: https://akkartik.name/freewheeling-apps You're absolutely right in general.
b0a04gl 4 hours ago [-]
yeah fair, i get that not everything has to be polished or production grade. and your work has that clarity purposefully scoped, honest about tradeoffs. that's rare.. i'm all for hobby tools and experiments, just want us to be upfront when things aren't ready, just trying to keep the bar from quietly sliding
invaliduser 4 hours ago [-]
But how can it be a problem? Working on a project just for fun is totally valid. Is this not «Hacker News»?
For the record, this is the definition of being a hacker by Stallman: «Being a programmer doesn't mean being a hacker: it means appreciating playful cleverness. Now, you can program without being playfully clever and you can be playfully clever in other fields without programming.»
b0a04gl 2 hours ago [-]
totally fine to build for fun. nobody's saying otherwise. the only thing i pushed back on was when we treat these as more than what they are. i've built plenty of broken toys, but i try not to oversell them. call it a browser demo? cool. call it a terminal alternative? then yeah, i'm going to ask about input, rendering, and js. if that’s too much, maybe i’m just in the wrong thread. no hard takes here
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...)
That said, for the actual escape sequences, XTerm's ctlseqs.ms[1] is an invaluable resource. I also took many ideas from nick black's notcurses[2], and I especially recommend his notes on "sprixels".[3]
[1]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
[2]: https://nick-black.com/dankwiki/index.php/Notcurses
[3]: https://nick-black.com/dankwiki/index.php/Theory_and_Practic...
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.
Slightly off topic but I’d love to see a list of mainly text sites.
My two favourites are https://plaintextsports.com/ and https://lite.cnn.com/
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!
Could you please pull the macos-input branch from https://git.sr.ht/~bptato/chawan and report back on what the `a` file includes after opening a site and typing some commands? (Should be created in the current working directory.)
``` handleCommandInput 1, buffer "" c 'j' handleCommandInput 2, buffer "" c 'j' after handleCommandInput, buffer 0x104c5b780"j" c 'j' handleCommandInput 1, buffer "" c 'k' handleCommandInput 2, buffer "" c 'k' after handleCommandInput, buffer 0x104ca8b70"k" c 'k' handleCommandInput 1, buffer "" c 'l' handleCommandInput 2, buffer "" c 'l' after handleCommandInput, buffer 0x104c5bab0"l" c 'l' handleCommandInput 1, buffer "" c 'k' handleCommandInput 2, buffer "" c 'k' after handleCommandInput, buffer 0x104ca8d20"k" c 'k' handleCommandInput 1, buffer "" c 'j' handleCommandInput 2, buffer "" c 'j' after handleCommandInput, buffer 0x104c5b480"j" c 'j' handleCommandInput 1, buffer "" c 'h' handleCommandInput 2, buffer "" c 'h' after handleCommandInput, buffer 0x104ca89c0"h" c 'h' handleCommandInput 1, buffer "" c 'g' handleCommandInput 2, buffer "" c 'g' after handleCommandInput, buffer 0x104cae780"g" c 'g' handleCommandInput 1, buffer "" c '1' after handleCommandInput, buffer "" c '1' handleCommandInput 1, buffer "" c '2' after handleCommandInput, buffer "" c '2' handleCommandInput 1, buffer "" c '3' after handleCommandInput, buffer "" c '3' handleCommandInput 1, buffer "" c '1' after handleCommandInput, buffer "" c '1' handleCommandInput 1, buffer "" c '2' after handleCommandInput, buffer "" c '2' handleCommandInput 1, buffer "" c '2' after handleCommandInput, buffer "" c '2' handleCommandInput 1, buffer "" c '3' after handleCommandInput, buffer "" c '3' handleCommandInput 1, buffer "" c '\3' handleCommandInput 2, buffer "" c '\3' after handleCommandInput, buffer 0x104cae690"\3" c '\3' handleCommandInput 1, buffer "" c '\3' handleCommandInput 2, buffer "" c '\3' after handleCommandInput, buffer 0x104adaed0"\3" c '\3' handleCommandInput 1, buffer "" c '\3' handleCommandInput 2, buffer "" c '\3' after handleCommandInput, buffer 0x104ca8720"\3" c '\3' handleCommandInput 1, buffer "" c '\4' handleCommandInput 2, buffer "" c '\4' after handleCommandInput, buffer 0x104bf8d80"\4" c '\4' handleCommandInput 1, buffer "" c '\3' handleCommandInput 2, buffer "" c '\3' after handleCommandInput, buffer 0x104caaa80"\3" c '\3' handleCommandInput 1, buffer "" c '\4' handleCommandInput 2, buffer "" c '\4' after handleCommandInput, buffer 0x104ca8e40"\4" c '\4' ```
OK, let's try something else. On master, is anything written to the status line if you press `p` when started with
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).
But if you really want custom CSS for grid displays, chawan does support the standard "grid" media feature: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/grid
I see you don't use termcap/ncurses anymore. Do you perform terminal handling yourself directly?
Thanks again!
I started with termcap because I was already familiar with it through w3m. But termcap is an obsolete interface, and cannot describe the only useful attribute for modern terminals (true color). Its only benefit was "maybe it accidentally works on a hardware terminal from the 80s", which is cool but not really worth the extra failure mode.
So instead of migrating to terminfo, I ditched it completely in favor of terminal queries (which were already necessary for other reasons). There is still a built-in terminal database, to detect known TERM values with XTerm incompatibilities. But a terminal that correctly responds to queries will work out of the box, even if its TERM value is unknown.
Is that your design choice not having "Open URL"(Address bar) feature?
And nice to see there's a new elinks alternative.
If you're interested, I posted a user style for HN here: https://lists.sr.ht/~bptato/chawan-devel/%3CD9S40OS2QWHL.PXQ...
Mainly just to fix the vote arrows, because for now background-image only renders placeholders.
For navigation in particular you'd use capital D to discard the current buffer and return to the previous page. There's also , (comma, back) and . (period, forward), which non-destructively cycle through the stack.
(Well, it's really a tree, but the UI mostly treats it as a stack.)
Nim is wonderful language and I am glad to see it used for this.
...those pesky GUI users want pixel-precision :P
Surely it's a hobby project. You have to have very specific tastes to browse in the terminal in 2025.
> using external binaries for protocols feels like sidestepping the real engineering
You could easily move all protocols to the main binary. The reason for the current arrangement is that this way, you can e.g. replace the HTTP handler with curl-impersonate, or add custom protocols like magnet (etc.) See the bonus directory in the sources for inspiration.
> tied to niche image formats like sixel/kitty which barely anyone supports.
Sixel & Kitty are the only image formats anybody supports. The alternatives are ASCII art (fun, but too pixelated) & hacking images onto the terminal thru the display server (is that still a terminal-based app?) But I'm happy to discuss further, I find the issue fascinating :)
> mac
The macOS issue is largely a function of the only person working on this not having a mac. If you do, you can help solving it by debugging it yourself & posting the results: https://todo.sr.ht/~bptato/chawan/63
I can totally relate with your frustration. Here, come criticize my half-stack instead: https://akkartik.name/freewheeling-apps You're absolutely right in general.
For the record, this is the definition of being a hacker by Stallman: «Being a programmer doesn't mean being a hacker: it means appreciating playful cleverness. Now, you can program without being playfully clever and you can be playfully clever in other fields without programming.»
If you use a compatible terminal emulator.