Skip to content

Hint Mode

Hint Mode lets you act on text in the visible terminal viewport without using the mouse. Otty labels every matching target with a one-, two-, or three-letter code; type the complete code to run the configured action.

Activating

Hint Mode does not have a default shortcut. On macOS, start the original open-link action from Shell → Open Link (Hint Mode), find it in the Command Palette, or assign one of these actions under Settings → Key Bindings:

ActionTargetsResult
Hint: OpenLinks and file pathsOpen the selected target
Hint: CopyLinks and file pathsCopy its URL or resolved path
Hint: PasteLinks and file pathsInsert its visible text at the terminal cursor
Hint: RevealFile pathsReveal the selected file in Finder

For example, this makes ⌘⇧Y copy a hinted URL or path:

ini
keybind = cmd+shift+y=hint_copy

The legacy toggle_hint_mode action remains available:

ini
keybind = cmd+shift+j=toggle_hint_mode

With Hint: Open or toggle_hint_mode, hold Shift while typing the final label character to copy instead of open. Esc cancels Hint Mode, and Backspace removes the last label character.

Matchers and actions

Custom Hint Mode bindings use this action format:

text
hint:<matcher>:<action>

The built-in matchers are:

MatcherMatches
linkURLs, OSC 8 hyperlinks, and file paths
urlURLs and OSC 8 hyperlinks
pathFile paths
wordWord-like tokens of at least three characters
ipIPv4 and IPv6 addresses
hash7–64 character hexadecimal hashes

The actions are open, copy, paste, and reveal. For example, this is the equivalent of hinting words and inserting the selected word at the cursor:

ini
keybind = cmd+opt+w=hint:word:paste

To copy a word instead:

ini
keybind = cmd+opt+c=hint:word:copy

paste inserts the exact text displayed in the terminal and uses Otty's normal paste-protection checks. copy uses the resolved URL or absolute path for link targets and the exact displayed text for text matchers.

Custom regular expressions

Define a named regular expression with a repeated hint-pattern setting, then use that name as the matcher:

ini
hint-pattern = ticket=OTTY-[0-9]+
keybind = cmd+opt+t=hint:ticket:copy

If the expression contains a numbered capture group, Otty hints the first group; otherwise it hints the whole match:

ini
hint-pattern = pr=PR-([0-9]+)
keybind = cmd+opt+p=hint:pr:paste

Pattern names may contain ASCII letters, digits, _, and -; the built-in names link, url, path, word, ip, and hash are reserved. Invalid names and regular expressions are rejected when the configuration is loaded.

URL templates and commands

An open action may include a URL template. Otty replaces {0} with the exact matched text:

ini
keybind = cmd+opt+o=hint:ticket:open:https://github.com/search?q={0}

A run action launches a command without invoking a shell:

ini
keybind = cmd+opt+r=hint:ticket:run:open https://github.com/search?q={0}

The command template is split into arguments before {0} is substituted, so matched terminal text cannot inject extra arguments or shell operators. If the template omits {0}, Otty appends the matched text as its final argument.

Scope

Hints are computed from the visible viewport when the mode starts. Labels stay attached to their targets while you scroll, but newly visible text is not added until you start Hint Mode again.

Differences from ⌘click

⌘click acts on the single target under the pointer. Hint Mode labels every matching target in the viewport and can open, copy, paste, reveal, or pass it to a command entirely from the keyboard.

See also

Otty