Rio term
tl;dr: Rio is a terminal built to run everywhere, as a native desktop applications by Rust/WebGPU or even in the browser powered by WebAssembly/WebGPU.
Demo
Summary
About Rio
Website: https://raphamorim.io/rio
If you are using or want to help in any way please consider to donate via Github Sponsors.
Rio would not be possible without few acknowledgements and specially Alacritty, since a lot of Rio functionalities (e.g: ANSI parser, events, grid system) was originally written (and still uses a good amount) of Alacritty code.
A terminal application that's built with Rust, WebGPU, Tokio runtime. It targets to have the best frame per second experience as long you want, but is also configurable to use as minimal from GPU.
Below some of work in progress Rio's features:
- Renderer based on Redux state machine.
- WebAssembly plugin system.
- Cross-platform.
- Configurable (Render level, colors, icons, fonts).
- Offloads rendering to the GPU for lower system load.
- Uses threaded rendering for absolutely minimal latency.
- Tabs support.
Rio renderer is based on redux state machine, lines that has not updated will not suffer a redraw. Looking for the minimal rendering process in most of the time. Rio is also designed to support WebAssembly runtime so in the future you will be able to define how a tab system will work with a WASM plugin written in your favorite language.
Rio uses WGPU, which is an implementation of WebGPU for use outside of a browser and as backend for firefox's WebGPU implementation. WebGPU allows for more efficient usage of modern GPU's than WebGL. More info
It also relies on Rust memory behavior, since Rust is a memory-safe language that employs a compiler to track the ownership of values that can be used once and a borrow checker that manages how data is used without relying on traditional garbage collection techniques. More info
Configuration File
The configuration should be the following paths otherwise Rio will use the default configuration.
- macOS path:
~/.rio/config.toml
Default configuration of config.toml
:
# Rio default configuration file
performance = "High"
height = 438
width = 662
[style]
font = "Firamono"
font-size = 16
theme = "Basic"
[advanced]
tab-character-active = '●'
tab-character-inactive = '■'
disable-renderer-when-unfocused = false
[developer]
enable-fps-counter = false
log-level = 'OFF'
[colors]
background = '#0F0D0E'
black = '#231F20'
blue = '#006EE6'
cursor = '#F38BA3'
cyan = '#88DAF2'
foreground = '#F9F4DA'
green = '#0BA95B'
magenta = '#7B5EA7'
red = '#ED203D'
tabs = '#F9C5D1'
tabs-active = '#FC7428'
white = '#F1F1F1'
yellow = '#FCBA28'
dim-black = '#1C191A'
dim-blue = '#0E91B7'
dim-cyan = '#93D4E7'
dim-foreground = '#ECDC8A'
dim-green = '#098749'
dim-magenta = '#624A87'
dim-red = '#C7102A'
dim-white = '#C1C1C1'
dim-yellow = '#E6A003'
light-black = '#2C2728'
light-blue = '#44C9F0'
light-cyan = '#7BE1FF'
light-foreground = '#F2EFE2'
light-green = '#0ED372'
light-magenta = '#9E88BE'
light-red = '#F25E73'
light-white = '#FFFFFF'
light-yellow = '#FDF170'
performance
Set terminal WGPU rendering perfomance.
- High: Adapter that has the highest performance. This is often a discrete GPU.
- Low: Adapter that uses the least possible power. This is often an integrated GPU.
See more in https://docs.rs/wgpu/latest/wgpu/enum.PowerPreference.html
# <performance> Set WGPU rendering perfomance
# default: High
# options: High, Low
# High: Adapter that has the highest performance. This is often a discrete GPU.
# Low: Adapter that uses the least possible power. This is often an integrated GPU.
performance = "High"
height
Set terminal window height.
# <height> Set default height
# default: 438
height = 400
width
Set terminal window width.
# <width> Set default width
# default: 662
width = 800
cursor
Set cursor character.
# default: '█'
# (Underline)
cursor: '_'
# (Beam)
cursor: '|'
# Other possibilities
cursor: '❤' # (U+2764)
Style
font
This property will change later to an actual font path. Currently Rio has 2 fonts builtin: Firamono
, Novamono
.
[style]
font = "Firamono"
font-size
Sets font size.
[style]
font-size = 16.0
Advanced
tab-character-active
This property sets a char
for an active tab.
[style]
tab-character-active = '●'
tab-character-inactive
This property sets a char
for an inactive tab.
[style]
tab-character-inactive = '■'
disable-renderer-when-unfocused
This property disable renderer processes until focus on Rio term again.
[style]
disable-renderer-when-unfocused = false
Developer
log-level
This property enables log level filter. Default is OFF
.
[style]
log-level = 'INFO'
enable-fps-counter
This property enables frame per second counter.
[style]
enable-fps-counter = false
Colors
Rio default colors:
The image above was produced by coolors.co.
Usage example running the following bash script:
for x in {0..8}; do
for i in {30..37}; do
for a in {40..47}; do
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
done
echo
done
done
echo ""
Or one-liner:
for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo ""
Development Status
Basic features are under development for MacOs right now.
Platform | Development Status |
---|---|
MacOs as desktop application | In development |
Linux as desktop application | In development |
Windows as desktop application | Not started yet |
Web Browser (tests on Chrome and Firefox) | Not started yet |
Nintendo Switch | Not started yet |
* Development and tests are targeting Wayland, probably is not stable on X11 yet.
Acknowledgments
- Rio logo was made using Adobe Sketchbook on iPad.
- The default color palette is based on the colors of ui.dev.
- Text glyph render is from https://github.com/hecrj/wgpu_glyph
- https://github.com/wez/wezterm
- https://www.gaijin.at/en/infos/ascii-ansi-character-table#asciicontrol
- https://en.wikipedia.org/wiki/ANSI_escape_code