ttypo
A terminal-based typing test built with Rust and Ratatui. Originally forked from max-niederman/ttyper.
features
- File mode - passing a file preserves original line breaks, indentation, and empty lines
- ASCII mode (
--ascii) - skips non-ascii characters during typing, highlighted in yellow - Live status bar - shows WPM, elapsed time, and word progress while typing
- Full-width progress bar - visual progress indicator below the prompt
- Missed words panel - results screen shows which words had errors
- Practice missed words - press
pon results to practice missed words - Repeat test - press
ron results to repeat the test - Pause/resume - press
escto pause,cto continue - Mistake markers on chart - red dots on the WPM chart show when errors occurred
- Theme - richer default color scheme using RGB values
- Stdin support - pipe text in with
-(e.g.man ls | ttypo --ascii -)
installation
usage
ttypo [OPTIONS] [PATH] [COMMAND]
Arguments:
[PATH] Read test contents from the specified file, or "-" for stdin
Options:
-d, --debug
-w, --words <N> Specify word count [default: 50]
-c, --config <PATH> Use config file
--language-file <PATH> Specify test language in file
-l, --language <LANG> Specify test language
--list-languages List installed languages
--no-backtrack Disable backtracking to completed words
--sudden-death Enable sudden death mode to restart on first error
--no-backspace Disable backspace
--ascii Display all but skip non-ASCII characters during typing
-h, --help Print help
-V, --version Print version
examples
| command | test contents |
|---|---|
ttypo |
50 of the 200 most common english words |
ttypo -w 100 |
100 of the 200 most common English words |
ttypo -w 100 -l english1000 |
100 of the 1000 most common English words |
ttypo --language-file lang |
50 random words from the file lang |
ttypo text.txt |
contents of text.txt with original line layout |
ttypo --ascii source.rs |
type a source file, skipping non-ASCII characters |
man ls | ttypo --ascii - |
practice typing a man page from stdin |
languages
The following languages are available by default:
| name | description |
|---|---|
c |
The C programming language |
cpp |
The C++ programming language |
csharp |
The C# programming language |
english100 |
100 most common English words |
english200 |
200 most common English words |
english1000 |
1000 most common English words |
english-advanced |
Advanced English words |
english-ngrams |
300 common English n-grams |
english-pirate |
50 pirate speak English words |
french100 |
100 most common French words |
french200 |
200 most common French words |
french1000 |
1000 most common French words |
galician |
185 most common Galician words |
german |
207 most common German words |
german1000 |
1000 most common German words |
german10000 |
10000 most common German words |
go |
The Go programming language |
html |
HyperText Markup Language |
java |
The Java programming language |
javascript |
The Javascript programming language |
korean100 |
100 most common Korean words |
korean200 |
200 most common Korean words |
norwegian |
200 most common Norwegian words |
php |
The PHP programming language |
portuguese |
100 most common Portuguese words |
portuguese200 |
200 most common Portuguese words |
portuguese1000 |
1000 most common Portuguese words |
portuguese-advanced |
Advanced Portuguese words |
python |
The Python programming language |
qt |
The QT GUI framework |
ruby |
The Ruby programming language |
rust |
The Rust programming language |
thai |
4000 most common Thai words |
spanish |
100 most common Spanish words |
sql |
Structured Query Language |
ukrainian |
100 most common Ukrainian words |
russian |
200 most common Russian words |
russian1000 |
1000 most common Russian words |
russian10000 |
10000 most common Russian words |
Additional languages can be added by creating a file in the config language directory with a word on each line. On Linux, the config directory is $HOME/.config/ttypo/language; on macOS it's $HOME/Library/Application Support/ttypo/language.
config
Configuration is specified by config.toml in the config directory (e.g. $HOME/.config/ttypo/config.toml).
Default values:
# the language used when one is not manually specified
= "english200"
[]
# default style (includes empty cells)
= "none"
# title text
= "e6e6e6;bold"
## test styles ##
# prompt box border
= "505078"
# border type
= "rounded"
# correctly typed words
= "64c864"
# incorrectly typed words
= "e65050"
# untyped words
= "5a5a5a"
# correctly typed letters in current word
= "78e678;bold"
# incorrectly typed letters in current word
= "ff6450;bold"
# untyped letters in current word
= "c8c8dc;bold"
# cursor character
= "none;reversed;bold"
# skipped non-typeable characters (--ascii flag)
= "c8b43c"
## status bar styles ##
# live WPM counter
= "64c864;bold"
# elapsed time
= "b4b4c8"
# word progress counter
= "b4b4c8"
# progress bar filled portion
= "64c864"
# progress bar empty portion
= "323232"
## results styles ##
# overview text
= "64c864;bold"
# overview border
= "505078"
# worst keys text
= "dcb43c;bold"
# worst keys border
= "505078"
# missed words text
= "e65050;bold"
# missed words border
= "505078"
# results chart line
= "50b4dc"
# mistake markers on chart
= "e65050"
# results chart x-axis label
= "6e6e6e"
# results chart y-axis label
= "6e6e6e;bold"
# restart/quit prompt
= "b4b4c8;bold"
style format
Styles are encoded as a string. Start with the color specification: a single color (foreground), or two colors separated by a colon (foreground and background). Colors can be a terminal color name, a 6-digit hex color code, none, or reset.
After the colors, optionally specify modifiers separated by semicolons:
bold, crossed_out, dim, hidden, italic, rapid_blink, slow_blink, reversed, underlined
Examples:
blue:white;italic-- italic blue text on a white backgroundnone;bold;underlined-- bold underlined text with no set color00ff00:000000-- green text on a black background
border types
plain, rounded (default), double, thick, quadrantinside, quadrantoutside