1
0
Fork
You've already forked chawan
0
forked from bptato/chawan
TUI web browser
  • Nim 50.1%
  • C 47.3%
  • HTML 1.9%
  • Shell 0.3%
  • Makefile 0.2%
  • Other 0.2%
Find a file
bptato 2fcce65400 term: misc optimization
* reduce format/color modes at writeGrid, not processFormat
* merge cell flag setting in processFormat into one SGR
* remove unnecessary clearEnd/resetFormat calls in partialDraw(Scroll)
2025年12月21日 19:51:00 +01:00
adapter man: work around OpenBSD portability bug 2025年12月20日 18:18:24 +01:00
bonus Fix typo 2025年12月17日 20:10:39 +01:00
doc Update docs 2025年12月20日 18:11:18 +01:00
lib fix get_bytes on ubuntu 2025年12月17日 20:22:41 +01:00
res term: misc fixes & improvements 2025年12月06日 18:57:36 +01:00
src term: misc optimization 2025年12月21日 19:51:00 +01:00
test term: misc optimization 2025年12月21日 19:51:00 +01:00
.gitignore xhr: more progress 2024年08月15日 19:23:55 +02:00
Makefile mancha: rewrite in sh 2025年12月07日 17:31:22 +01:00
md2man Improve man page generation 2025年07月26日 16:38:40 +02:00
NEWS Update news 2025年12月03日 21:02:59 +01:00
nim.cfg Refactor QJS wrapper 2025年10月30日 21:11:48 +01:00
README.md Update docs 2025年12月06日 17:38:54 +01:00
todo pager: alert on external command failure 2025年11月29日 13:16:53 +01:00
UNLICENSE Public domain 2023年06月24日 21:55:07 +02:00

Chawan is a TUI web (and (S)FTP, Gopher, Gemini, ...) browser with CSS, inline image and JavaScript support.

It uses its own small browser engine developed from scratch, which can nevertheless display many websites in a manner similar to major graphical browsers.

It can also be used as a terminal pager.

Screenshot of Chawan displaying its SourceHut page

Compiling

A Unix-like operating system (Linux, *BSD, Haiku, macOS, ...) is assumed. On Windows you have to use WSL.

  1. Clone the Chawan repository:
    git clone https://git.sr.ht/~bptato/chawan && cd chawan
  2. Install the Nim compiler: https://nim-lang.org/install.html
    • Please use 2.0.0 or newer, ideally 2.2.6. (nim -v displays your Nim compiler's version.) The 1.6 branch from 1.6.14 upwards may still work, but it isn't recommended unless you have no other choice.
    • If you are using a 32-bit system, you probably need 2.2 or newer. 2.0 may still work if you export CFLAGS=-fpermissive.
  3. Install the following dependencies:
    • OpenSSL (or LibreSSL)
    • libssh2
    • brotli
    • pkg-config
    • GNU make (gmake on non-GNU systems)
    • Quick copy-paste for Debian: apt install libssh2-1-dev libssl-dev libbrotli-dev pkg-config make
  4. Run make (without arguments).
  5. Install using make install (e.g. sudo make install).

Then, try:

$ cha -V # open in visual mode for a list of default keybindings
$ cha example.org # open your favorite website directly from the shell
$ mancha cha # read the cha(1) man page using `mancha'

Packages

You can also install Chawan from packages maintained by volunteers. Known stable packages are:

Unstable packages (tip of the master branch):

Each release also comes with static binaries. However, their dependencies can quickly get out of date, so installing a package or compiling Chawan yourself is preferable.

Features

Currently implemented features are:

  • multi-processing, incremental loading of documents
  • HTML5 support with various encodings (UTF-8, Shift_JIS, GBK, ...), forms, cookies
  • CSS-based layout engine: supports flow layout, table layout, flexbox layout, double-width characters (CJK)
  • user-programmable keybindings (defaults are vi(m)-like), mouse support
  • JavaScript support in documents (disabled by default)
  • inline image support with Sixel or Kitty protocol (disabled by default; see doc/image.md on how to enable)
  • supports several network protocols: HTTP(S), (S)FTP, Gopher, Gemini, Finger, Spartan
  • markdown viewer (cha README.md), man page viewer (mancha)
  • user-defined protocols and file formats
  • syscall filter based sandboxing on FreeBSD, OpenBSD and Linux (through capsicum, pledge and seccomp-bpf)
  • bookmarks, history

...with a lot more planned.

Bugs, technical issues, etc.

First, read the troubleshooting document. If it doesn't help, open a ticket.

When using the ticket tracker, please make sure your tickets are valid markdown, or they become unreadable on the web interface.

If you want to send plain text e-mails not formatted as markdown, use the mailing list instead. This is also where you can send patches.

If you're having troubles accessing SourceHut, you can also use the Codeberg mirror.

Documentation index

Chawan's documentation is available as man pages (man cha) and as Markdown files.

If you're interested in modifying the code:

Relatives

w3m has been the main inspiration for Chawan; although the two do not share code, the UI and feature set is similar.

Ferus is a separate graphical browser engine written in Nim, which uses Chawan's HTML parser.

License

Chawan is dedicated to the public domain. See the UNLICENSE file for details.

Chawan also includes and depends on several permissively licensed libraries. For further details, check the about:license page in Chawan, or read the same document here.