As you type in the Notchly terminal, a ghost text suggestion appears inline after your cursor. The suggestion is drawn from the same command store as the command palette — your recorded commands, imported zsh history, and ~450 built-in defaults — and is ranked by how often and how recently you’ve used each command. You don’t need to open any menu; the suggestion appears automatically and disappears the moment it’s no longer relevant.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/javierpr0/Notchly/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Autocomplete activates when you have typed 2 or more characters at a shell prompt (detected by a trailing$, %, or > character). After a short debounce delay following each keypress, the engine scans the command store for the current project directory and picks the best match.
Matching strategy
Matching strategy
The engine tries two passes in order:
- Prefix match — the command starts with exactly what you’ve typed (case-insensitive). Prefix matches receive a base score of 100.
- Fuzzy match — the typed characters appear in order anywhere in the command. Fuzzy matches receive a base score of 40.
Ranking and scoring
Ranking and scoring
After the base score, two bonuses are applied:
- Frequency bonus —
log2(run_count + 1) × 5, capped at 30. This rewards commands you use often without letting a single heavily-used command permanently dominate every suggestion. - Recency bonus — 20 points if used today, 10 points within the last 7 days, 5 points within the last 30 days, 0 otherwise.
−0.1 × character_count) gives a slight preference to shorter, less-noisy commands when scores are otherwise equal. The top suggestion from this ranked list is shown as the ghost text.Ghost text rendering
Ghost text rendering
The suggestion is rendered by
GhostTextView, an NSView subview placed directly inside the terminal view at the cursor position. The text is drawn in white at 35% opacity using the same monospaced font as the terminal. Cell width is computed using the same glyph-advancement formula that SwiftTerm uses internally, so the ghost text aligns precisely with the terminal grid at any font size.Accepting a suggestion
Two keys accept the current ghost text suggestion:- Tab — accepts the full ghost text and inserts the complete command into the terminal input.
- Right Arrow → — accepts the suggestion without moving your hands away from the arrow keys.
- Press Enter to run a command
- Press Backspace past the point where the suggestion matched
- Press Escape
- Type a character that leaves no matching suggestion
Performance
Autocomplete is designed to add no overhead to tabs you’re not actively using.- Focus-only scanning — the suggestion engine only runs for the terminal pane that currently has keyboard focus. Background tabs do not schedule debounce timers or scan their command store, so opening many tabs does not add CPU work on each keystroke.
- Lowercased cache — each command string is lowercased once and cached. The per-keystroke scoring loop reads the cached lowercase form instead of re-lowercasing on every comparison, which matters when the store holds hundreds of entries.
- Bounded suggestions — after scoring all commands in the store, the engine returns at most 7 top-ranked results. The suggestion shown as ghost text is always the highest-scoring entry from that set.
Relationship to the command palette
Autocomplete and the command palette share the sameCommandStore. Any command you run — whether typed directly, accepted from ghost text, or executed from the palette — is recorded in one place. The zsh history import (~/.zsh_history) runs at most once per process launch and the result is cached in memory, so reopening a project directory doesn’t trigger another disk read.