Skip to content
isenePublic

About

Pure assembly file viewer with syntax highlighting. Part of CHasm.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

show - Pure Assembly File Viewer

Version Assembly License Platform Dependencies Binary

File viewer with syntax highlighting, written in x86_64 Linux assembly. No libc, no runtime, pure syscalls. Single static binary, 38KB.

A less/cat/bat replacement. Three modes: full-screen pager, cat-style output, and embeddable pane output for TUI applications.


Install

git clone https://github.com/isene/show.git
cd show
make
sudo make install

Live reload

show follows a file that other processes rewrite. Leave it open on a log, a generated report or a file you are editing in another window, and the view updates as the file changes.

  • Written in place, or replaced atomically (write temp, rename over): both are picked up. The second is what vim, scribe and the CHasm config tools do, and it orphans a naive watch, so the watch re-arms on the path.
  • Parked at the bottom, it stays at the bottom, so a growing file follows like tail -f. Anywhere else, your position is kept.
  • Costs nothing when nothing happens: an inotify fd joins the keyboard in a single blocking poll, so an idle pager makes no wakeups at all. The watch is on the file itself, not its directory, so a busy directory full of other files never interrupts it.
  • Piped input (cmd | show) has no file to follow and is unchanged.

As a tail -f

show /var/log/syslog       # then press G

G parks you at the end, and from there every append scrolls into view, with syntax colours and the pager's search and navigation still available. Press g (or scroll up) to stop following and read back through the file: appends keep arriving, but the view stays where you put it. G again to resume following.

Unlike tail -f this costs nothing while the file is quiet, and unlike less +F you are never locked out of the pager: the keyboard stays live the whole time.

Usage

show file.rb              # full-screen pager (if stdout is a terminal)
show file.py | grep def   # cat mode with colors (if stdout is a pipe)
echo "hello" | show       # pipe mode (reads stdin, pages like less)
show --lines 10-30 file.c # pane mode (for embedding in TUI apps)
show /var/log/syslog      # live view; press G to follow it like tail -f

Screenshot

show screenshot

Key Bindings (Pager Mode)

Key Action
j / Down Scroll down one line
k / Up Scroll up one line
Space / PgDn Page down
b / PgUp Page up
g / Home Go to top
G / End Go to bottom
l Toggle line numbers
Left / Right Horizontal scroll
/ Search forward (Enter runs it, Esc cancels)
n Jump to the next match
N Jump to the previous match
q Quit

Every match on a visible line is shown in reverse video, so you can see which word was hit and how many times.

Search wraps at either end of the file, and follows vim's smartcase rule: an all-lower-case pattern ignores case, a pattern with any capital in it matches exactly. A pattern that matches nothing says pattern not found in the status bar and leaves the view where it is.

Syntax Highlighting

20+ languages with keyword, type, function, string, comment, number, and operator coloring:

Language Extensions
Assembly .asm, .s
C/C++ .c, .h, .cpp, .hpp, .cc
C# .cs
Forth .fth, .4th, .forth
Go .go
Java .java
JavaScript/TypeScript .js, .ts, .jsx, .tsx
Julia .jl
Lua .lua
Python .py
Ruby .rb, .gemspec
Rust .rs
Shell .sh, .bash, .zsh, .fish
XRPN .xrpn
JSON .json
YAML .yaml, .yml
TOML .toml
Markdown .md
Config .conf, .cfg, .ini

Shebang detection: files without extensions are identified by #!/...ruby, #!/...python, etc.

Color Scheme

Element Color
Keywords Hot pink (197)
Strings Green (78)
Comments Gray (242)
Numbers Purple (141)
Types Cyan (81)
Functions Yellow-green (148)
Operators Light gray (248)
Line numbers Dark gray (240)

Colors match the pointer file manager's built-in highlighter.

Modes

Pager mode (default when stdout is a terminal): full-screen with scrolling, status bar, and line numbers. Uses alternate screen buffer.

Cat mode (when stdout is a pipe): outputs all lines with syntax highlighting and line numbers. Works like bat or cat with colors.

Piped input (cmd | show): stdin is slurped, then show reopens /dev/tty for the keyboard and runs the full pager — the same trick less uses. If stdout is also piped (or there is no controlling terminal), it falls back to cat mode.

Pane mode (--lines M-N): outputs a specific line range with highlighting. No raw mode, no key handling. Designed for embedding in TUI applications like pointer and RTFM.

Part of CHasm (CHange to ASM)

Tool Purpose Binary
show File viewer 40KB
bare Interactive shell 150KB
glass Terminal emulator 110KB
tile Window manager + strip status bar 70KB
chasm-bits Status-bar asmites ~5KB each
glyph TrueType rasterizer 37KB

License

Unlicense - public domain.

Credits

Created by Geir Isene (https://isene.org) with pair-programming with Claude Code.

About

Pure assembly file viewer with syntax highlighting. Part of CHasm.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages