Hints
Rio's hints system allows you to quickly interact with text patterns in your terminal by displaying keyboard shortcuts over matching content. This feature allows for quick interaction with terminal content through keyboard shortcuts.
How it works
When you activate hint mode, Rio scans the visible terminal content for patterns you've configured (like URLs, file paths, or email addresses) and displays keyboard shortcuts over each match. You can then press the corresponding keys to perform actions on the matched text.
Default hints
Rio ships with one rule out of the box that matches three kinds of clickable text. The default regex is ported verbatim from ghostty and uses oniguruma syntax (lookbehinds, lookaheads supported):
- Schemed URLs —
http://,https://,file:,ssh:,mailto:,magnet:,ipfs://,gemini://,gopher://,git://,news:,ipns:,ftp://,tel:. IPv6 literals and bracketed parentheses inside URLs are handled. - Rooted or explicitly-relative paths —
/abs/path,./rel,../rel,~/Desktop,.config/foo,$HOME/x,$XDG_CONFIG_HOME/x. Mid-word slashes (the/barinsidefoo/bar) are rejected via lookbehind. Paths with internal spaces are matched when they contain a dotted filename segment (e.g.~/My\ Documents/notes.md). - Bare relative paths with a dotted filename —
src/main.rs,lib/foo.zig:42:10. A dotted segment is required, so ambiguous strings likefoo/bararen't matched.
When you click a path-like match (or use the keyboard hint), rio resolves it against the terminal's working directory (reported by your shell via OSC 7), expands ~/ and $VAR/, and dispatches the absolute path to the OS opener (open/xdg-open/cmd /c start) only if the file exists. URL-scheme matches are passed through unchanged.
To get OSC 7 working from your shell:
# bash/zsh — emit OSC 7 on every prompt
PROMPT_COMMAND='printf "\033]7;file://%s%s\033\\" "$HOSTNAME" "$PWD"'
# fish
function osc7_cwd --on-event fish_prompt
printf "\033]7;file://%s%s\033\\" $hostname (pwd)
end
OSC 8 hyperlinks (escape-sequence-marked links emitted by tools like ls --hyperlink=auto or modern shell prompts) are detected separately and always underlined while visible — no modifier required.
Basic Usage
- Activate hint mode: Press the configured key binding (default varies by hint type)
- Navigate: Type the letters shown over the hint you want to select
- Execute: The configured action (copy, open, paste, etc.) will be performed