Skip to content

Feat/terminal autosuggestions#735

Open
oh4-beep wants to merge 2 commits into
crynta:mainfrom
oh4-beep:feat/terminal-autosuggestions
Open

Feat/terminal autosuggestions#735
oh4-beep wants to merge 2 commits into
crynta:mainfrom
oh4-beep:feat/terminal-autosuggestions

Conversation

@oh4-beep

@oh4-beep oh4-beep commented Jun 5, 2026

Copy link
Copy Markdown

What

Why

How

Testing

  • pnpm exec tsc --noEmit clean
  • Manual smoke-test of the affected feature
  • (If you touched src-tauri/) cargo test --locked and cargo clippy --all-targets --locked -- -D warnings clean
  • (If you changed a #[tauri::command] signature) called out below so the FE caller can be updated in lockstep
  • (If UI) tested in pnpm tauri dev
  • Platforms tested:
  • Shells tested (if relevant):

Screenshots / GIFs

Notes for reviewer

oh4-beep and others added 2 commits June 5, 2026 20:53
Ghost-text completions drawn from the user's own shell history, in the
fish/zsh-autosuggestions style. Opt-in via the terminalSuggestions pref;
accept with Right arrow or End.

- commandHistory.ts: pure functional core (bounded most-recent-first ring
  with prefix matching) plus persistence to terax-command-history.json.
- osc-handlers.ts: prompt tracker gains optional lifecycle callbacks;
  commands captured from OSC 133;C;<cmd> (zsh/fish preexec).
- suggestionOverlay.ts: DOM ghost positioned over the grid. Never written
  into the xterm buffer or PTY, so a geometry miss is cosmetic, never
  corrupting. A module-level enabled flag short-circuits the per-frame
  render hook so the feature is zero-cost when off.
- rendererPool.ts: accept-key handling (Right/End at line end).
- Settings toggle + unit tests for the ring and OSC command capture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Accept the inline suggestion one token at a time with Alt+Right or
Ctrl+Right (zsh-autosuggestions forward-word), in addition to the
full accept on Right/End.

- suggestionChunk.ts: pure nextSuggestionChunk() boundary helper + tests.
- suggestionOverlay.ts: acceptWord() sends only the next chunk; the next
  render recomputes the shorter suggestion from history.
- rendererPool.ts: Alt/Ctrl+Right key handling, gated on an active ghost.
@oh4-beep oh4-beep requested a review from crynta as a code owner June 5, 2026 19:18
@oh4-beep

oh4-beep commented Jun 6, 2026

Copy link
Copy Markdown
Author

Wassup bro? Really liked the idea a while back so I thought I might help a little.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant