No description
Find a file
m1ngsama 860c8aaf56
🚀 Modern Browser Enhancements - Vimium-style Navigation & Beautiful Rendering (#11)
* feat: Add table, image, and nested list support to HTML parser

- Add Table, Image, and Form data structures
- Implement table extraction with proper row/column parsing
- Add image extraction with alt text and dimensions
- Implement recursive nested list parsing (ul/ol)
- Support ordered and unordered lists with nesting levels
- Extract list item numbers for ordered lists
- Add HEADING4-6, ORDERED_LIST_ITEM, TABLE, IMAGE element types

This enhancement allows TUT to properly extract and represent
structured content from HTML, enabling better rendering of
data-heavy websites.

* feat: Implement beautiful table and image rendering with box-drawing

- Add Unicode box-drawing characters for table borders (┌─┬─┐, │, etc.)
- Implement table rendering with proper column width calculation
- Add header row styling with heavy borders and bold text
- Support automatic text wrapping within table cells
- Implement image placeholder rendering with bordered boxes
- Display image alt text and dimensions (width × height)
- Enhance list rendering with different bullet styles per nesting level
  * Level 0: • (bullet)
  * Level 1: ◦ (white bullet)
  * Level 2: ▪ (small square)
  * Level 3: ▫ (white small square)
- Add ordered list rendering with proper numbering
- Support proper indentation for nested lists

These visual enhancements make TUT significantly more modern and
readable compared to traditional text browsers like w3m.

* feat: Add Vimium-style link hints and vim keybindings infrastructure

- Add LINK_HINTS mode for Vimium-style link navigation
- Implement 'f' key to activate link hints mode
- Add visual mode support (v/V keys)
- Implement marks support (m[a-z] to set, '[a-z] to jump)
- Add tab navigation keys (gt/gT for next/previous tab)
- Add new actions:
  * SHOW_LINK_HINTS - activate link hints overlay
  * FOLLOW_LINK_HINT - follow link by hint letters
  * ENTER_VISUAL_MODE / ENTER_VISUAL_LINE_MODE
  * SET_MARK / GOTO_MARK - vim-style position bookmarks
  * NEXT_TAB / PREV_TAB - tab navigation
  * YANK - copy selected text

This brings modern browser vim plugin functionality (like Vimium)
to the terminal, making link navigation much faster than traditional
tab-through methods.
2025-12-17 13:51:28 +08:00
.github/workflows refactor: Improve code quality and Unix philosophy 2025-12-08 15:53:17 +08:00
src 🚀 Modern Browser Enhancements - Vimium-style Navigation & Beautiful Rendering (#11) 2025-12-17 13:51:28 +08:00
.gitignore refactor: Improve code quality and Unix philosophy 2025-12-08 15:53:17 +08:00
CMakeLists.txt feat: Transform to vim-style terminal browser (#10) 2025-12-05 15:01:21 +08:00
LINK_NAVIGATION.md feat: Add inline link display and vim-style quick navigation 2025-12-08 17:07:40 +08:00
Makefile feat: Transform to vim-style terminal browser (#10) 2025-12-05 15:01:21 +08:00
README.md docs: Rewrite README as Unix man page, remove Chinese comments 2025-12-08 16:11:39 +08:00
test_inline_links.html feat: Add inline link display and vim-style quick navigation 2025-12-08 17:07:40 +08:00

TUT(1) - Terminal User Interface Browser

NAME

tut - vim-style terminal web browser

SYNOPSIS

tut [URL]

tut -h | --help

DESCRIPTION

tut is a text-mode web browser designed for comfortable reading in the terminal. It extracts and displays the textual content of web pages with a clean, centered layout optimized for reading, while providing vim-style keyboard navigation.

The browser does not execute JavaScript or display images. It is designed for reading static HTML content, documentation, and text-heavy websites.

OPTIONS

URL Open the specified URL on startup. If omitted, displays the built-in help page.

-h, --help Display usage information and exit.

KEYBINDINGS

tut uses vim-style keybindings throughout.

Navigation

j, Down Scroll down one line.

k, Up Scroll up one line.

Ctrl-D, Space Scroll down one page.

Ctrl-U, b Scroll up one page.

gg Jump to top of page.

G Jump to bottom of page.

[count]G Jump to line count (e.g., 50G jumps to line 50).

[count]j, [count]k Scroll down/up count lines (e.g., 5j scrolls down 5 lines).

Tab Move to next link.

Shift-Tab, T Move to previous link.

Enter Follow current link.

h, Left Go back in history.

l, Right Go forward in history.

/ Start search. Enter search term and press Enter.

n Jump to next search match.

N Jump to previous search match.

Commands

Press : to enter command mode. Available commands:

:q, :quit Quit the browser.

:o URL, :open URL Open URL.

:r, :refresh Reload current page.

:h, :help Display help page.

**:**number Jump to line number.

Other

r Reload current page.

q Quit the browser.

? Display help page.

ESC Cancel command or search input.

LIMITATIONS

tut does not execute JavaScript. Modern single-page applications (SPAs) built with React, Vue, Angular, or similar frameworks will not work correctly, as they require JavaScript to render content.

To determine if a site will work with tut, use:

curl https://example.com | less

If you can see the actual content in the HTML source, the site will work. If you only see JavaScript code or empty div elements, it will not.

Additionally:

  • No image display
  • No CSS layout support
  • No form submission
  • No cookie or session management
  • No AJAX or dynamic content loading

EXAMPLES

View the built-in help:

tut

Browse Hacker News:

tut https://news.ycombinator.com

Read Wikipedia:

tut https://en.wikipedia.org/wiki/Unix_philosophy

Open a URL, search for "unix", and navigate:

tut https://example.com
/unix<Enter>
n

DEPENDENCIES

  • ncurses or ncursesw (for terminal UI)
  • libcurl (for HTTPS support)
  • CMake >= 3.15 (build time)
  • C++17 compiler (build time)

INSTALLATION

From Source

macOS (Homebrew):

brew install cmake ncurses curl
mkdir -p build && cd build
cmake ..
cmake --build .
sudo install -m 755 tut /usr/local/bin/

Linux (Debian/Ubuntu):

sudo apt-get install cmake libncursesw5-dev libcurl4-openssl-dev
mkdir -p build && cd build
cmake ..
cmake --build .
sudo install -m 755 tut /usr/local/bin/

Linux (Fedora/RHEL):

sudo dnf install cmake gcc-c++ ncurses-devel libcurl-devel
mkdir -p build && cd build
cmake ..
cmake --build .
sudo install -m 755 tut /usr/local/bin/

Using Makefile

make
sudo make install

FILES

No configuration files are used. The browser is stateless and does not store history, cookies, or cache.

ENVIRONMENT

tut respects the following environment variables:

TERM Terminal type. Must support basic cursor movement and colors.

LINES, COLUMNS Terminal size. Automatically detected via ncurses.

EXIT STATUS

0 Success.

1 Error occurred (e.g., invalid URL, network error, ncurses initialization failure).

PHILOSOPHY

tut follows the Unix philosophy:

  1. Do one thing well: display and navigate text content from the web.
  2. Work with other programs: output can be piped, URLs can come from stdin.
  3. Simple and minimal: no configuration files, no persistent state.
  4. Text-focused: everything is text, processed and displayed cleanly.

The design emphasizes keyboard efficiency, clean output, and staying out of your way.

SEE ALSO

lynx(1), w3m(1), curl(1), vim(1)

BUGS

Report bugs at: https://github.com/m1ngsama/TUT/issues

AUTHORS

m1ngsama contact@m1ng.space

Inspired by lynx, w3m, and vim.

LICENSE

MIT License. See LICENSE file for details.