typecat
A C++ program that displays text from a file or stdin in a fun way - mimicking realistic manual typing. It even makes mistakes!
release date: 2026-01-04
about
typecat is a fast, lightweight and highly configurable command-line tool written in C++ (C++17) that displays text as if it were being typed in real time. It reads from files, stdin (pipes) or direct text arguments and renders output with realistic timing, optional typos, ANSI escape handling and line numbering.
It’s a fun and useful alternative to classic cat and modern bat/batcat - great for demos, screencasts, teaching, script testing or just spicing up your terminal output. Portable and easy to build on Linux, Termux and other Unix-like systems.
features
Features:
- Realistic character-by-character typing simulation with configurable speed.
- Optional random typos with adjustable probability.
- Proper handling of ANSI escape sequences (render colors) or textual representation of escapes.
- Line numbers (dimmed) and continued line prefix support.
- Read from file, stdin (pipe) or -t/--text inline arguments.
- Binary input detection with --show-all override.
- Audible bell on errors (optional).
- Robust, deterministic POSIX signal handling (SIGINT, SIGTERM, SIGQUIT, SIGHUP, SIGWINCH).
- Debug mode for runtime diagnostics.
- Minimal external dependencies — just a C++17 toolchain.
| Option | Description |
|---|---|
| -s, --speed <1-100> | Typing speed (default 50). Higher = faster / shorter delays. |
| -m, --mistakes [1-100] | Enable random typos. Optionally give chance as percent (default 10). |
| -c, --color | Interpret ANSI escape sequences (show colors). |
| -e, --print-escapes | Print ANSI escapes textually as \e[...] instead of interpreting them. |
| -b, --beep | Emit BEL on error conditions. |
| -t, --text <string> | Add a text line to display (multiple -t allowed). |
| -a, --show-all | Force showing input even if it looks binary. |
| -n, --line-numbers | Prepend dimmed line numbers. |
| -r, --allow-resize | Ignore SIGWINCH (allow terminal resize while typing). |
| --debug | Print debug info to stderr (useful for troubleshooting). |
| -h, --help | Show help and exit. |
| -v, --version | Show version and exit. |
| --codes | Show list of exit codes and signal handling info. |
compatibility
- Compatible with any UNIX-like system and distribution.
- Written in C++17 and requires minimal dependencies.