The officially official Devuan Forum!

You are not logged in.

#1 2025-01-04 11:15:37

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Textmode/Terminal Browser

Probably worth watching:

Chawan - a web browser for your terminal

https://sr.ht/~bptato/chawan/

My build of Nim-2.2.0 as /opt/nim "bonsai" on Devuan5 just has finished, but I've not built Chawan on Linux with it yet.  Strangely on the NetBSD9 I tried it on, it does build, but does not work correctly.  So here some snapshots of it running on OpenBSD7 viewed via SSH in an XTerm on Linux:

20250103-201720__chawan__home_sweet_home.png

20250103-175931__chawan__in_xterm.png

20250103-205007__chawan__wikipedia__double-plus-better.png

I'm probably still far from having it configured correctly (and optimally).

Offline

#2 2025-01-04 14:10:39

Camtaf
Member
Registered: 2019-11-19
Posts: 447  

Re: Textmode/Terminal Browser

Looks interesting, most text browsers are difficult to navigate with, I have found, but this is looking like we could do away with a GUI altogether.

Offline

#3 2025-01-04 14:52:23

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

~$ ls /opt/chawan/libexec/chawan/
ansi2html  dirlist2html  gopher2html  md2html  uri2html  urlenc
cgi-bin    gmi2html      img2html     nc       urldec
~$ ls /opt/chawan/libexec/chawan/cgi-bin/
about   chabookmark  finger  gemini  http  man      resize  sixel    stbi
canvas  file         ftp     gopher  jebp  nanosvg  sftp    spartan

There is much more under the hood than I mentioned.  Like W3M it plays (man)pager too, I assume dirlist2html will mimic W3M's file system viewer and seeing the smolweb protocols and even more being supported is really nice too.  I think its protocol diversity is in the same class as Elinks and Dillo while the overlap not completely is 1:1 to them.  E.g. Elinks currently is the only browser supporting fsp: I know of.

EDIT20240105
I mentioned the GUI browser Dillo side by side to Elinks because of its protocol diversity and I typically mention W3M and Emacs in the same context too.  Dillo is so easy to extend, that I could take it's Spartan plugin and turn it into one for the Nex protocoll easily.
/EDIT20240105

I've no idea what nanosvg is expected to do, my only own webpage with embedded SVG code did not render the graphic.

Meanwhile I've built it on Devuan5/armhf, NetBSD9.1/amd64, NetBSD9.3/amd64, NetBSD10.0/amd64 and OpenBSD7.3/amd64.  The Devuan5/armel build still crawls on a Pi1.  It works in most cases for all protocols I tested and as man viewer, but http: and https: refuse to work on the NetBSDs while the rest works.  As usual, answers will find me, so I'm patient with that situation.  OmmmMMMmmm...  ;-)

It gives me one wide smile after the other:

20250104-151324__chawan__sooo_cute.png

And I had a crash with postbank.de which probably has a gigantic amount of JS in its page.  Without JS being enabled it rendered and looked halfway familiar.  Lots of other JS-heavy pages don't work, but I care more for my own cheat sheets and outsourced reminders written in Orgmode/Org-Babel and for those Chawan is the first textmode/terminal browser that renders this stuff without butchering the layout:

20250104-152317__chawan__orgbabel_notes.png

I expect to discover more positive surprises.

Last edited by yeti (2025-01-05 09:13:11)

Offline

#4 2025-01-04 18:00:33

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

Testing login and quick reply.

Login works after accepting cookies (I'll do that with site specific rules for now) and clicking into the editarea opens my default text editor.  This is (N)VI on my ARM guinea pigs.

Well, I definitely had browsers before that were far less fun than this one.  \o/

Written on my Android phone a Pi2 using Chawan over SSH in XTerm.

EDIT: And "go back" looks like needing JS.

Last edited by yeti (2025-01-04 18:10:04)

Offline

#5 2025-01-05 07:49:19

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

I2P works.  \o/

20250105-073448__chawan__I2P_works.png

... still fighting with *.onion addresses.

Offline

#6 2025-01-06 08:09:36

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

Unfinished

..., but it looks surprisingly simple to add a protocol:

~$ cat .config/chawan/cgi-bin/nex
#!/bin/sh

printf 'Cha-Control: Connected\r\n'
printf 'Status: 200\r\n' # ~ HTTP OK
printf 'Cha-Control: ControlDone\r\n'
printf '\r\n'

printf '%s\n' "$MAPPED_URI_PATH" \
| nc "$MAPPED_URI_HOST" "${MAPPED_URI_PORT:-1900}"

##
## To do:
## - HTML-ify as <pre>...</pre>
## - links --> active
##
~$ cat .config/chawan/urimethodmap 
nex: /cgi-bin/nex
~$ cha nex://nightfall.city/nex/info/specification.txt
                           THE NEX PROTOCOL                                    
                                                                               
Nex is a simple internet protocol designed for distributed document            
retrieval. It's inspired by gopher and gemini.                                 
                                                                               
Servers should listen on port 1900. Afterall, night falls at 7pm!              
Users connect and send the server a path which may be empty. The               
server responds with text or binary data and close the connection. No          
state is retained.                                                             
                                                                               
Document content is returned as-is. Directory content use plain text           
with a special syntax where each line beginning by "=> " followed by a         
URL is considred a link. The URL can be absolute or relative. Here are         
examples:                                                                      
                                                                               
=> nex://my-site.net                                                           
=> about.txt                                                                   
=> ../nexlog/                                                                  
                                                                               
Clients can assume that an empty path or a path finishing with / is a          
directory. A document should be displayed based on the path's file             
extension. When there is no extension, plain text is assumed.                  
                                                                               
Here is an example telnet session:                                             
telnet nex.nightfall.city 1900                                                 
hello-world.txt                                                                
                                                                               
Hello world!                                                                   

\o/

Which surprise will be next?

Last edited by yeti (2025-01-06 09:54:10)

Offline

#7 2025-01-06 16:54:33

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

Gitea?  Really?
[[siteconf]]
host = "tildegit.org"
cookie = true
scripting = true

20250106-153524__chawan__gitea_at_tildegit.png

Login works.
Colourcancer danger zone.
Maybe this is worth some fine tuning and a repo to play with instead of risking to screw up the other ones.

Offline

#8 2025-01-25 00:38:57

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 360  

Re: Textmode/Terminal Browser

Google Image Search?

In an XTerm?

20250125-002559__chawan__google_images_search.png

Would you believe this without screenshot?

Offline

#9 2025-01-25 20:02:49

JWM-Kit
Member
Registered: 2020-06-29
Posts: 141  
Website

Re: Textmode/Terminal Browser

This looks great. Thanks for posting it.

Offline

Board footer