[Feature] Inline autocomplete inside terminals (shell-hook IPC + Claude Code TUI OCR)
Summary
Bring Cotabby's inline ghost-text autocomplete into terminal emulators and the Claude Code TUI — surfaces it currently stays out of. The prompt text is sourced from cooperative shell hooks (bash/zsh/fish) over a local user-only Unix-domain socket, and, for full-screen TUIs like Claude Code, from OCR of the prompt region.
Problem
Cotabby deliberately disables itself in terminals (#127, #201) and now suppresses ghost text in VS Code / Cursor integrated terminals (#656). That's a reasonable call — AX text fields are unreliable in those surfaces. But it leaves a large class of text entry (shell commands, Claude Code prompts) with no autocomplete, which some of us would really like to have.
Proposed direction
I've built a working implementation on my fork. It:
- Adds a shell-integration script (
cotabby.bash/.zsh/.fish) that reports the live prompt buffer to the app over a0600, user-owned Unix-domain socket — no AX guessing. - Detects the Claude Code TUI via OCR of the prompt region when shell integration isn't available.
- Re-enables suggestions in terminals only when a live integration source is actually present, so it does not reintroduce the AX flakiness #656 avoids; without an active source, terminals stay suppressed exactly as today.
- Is opt-in, off by default.
I fully recognize this reverses the direction of #656, and that it adds real surface area (a local IPC server, injected shell hooks, process-tree inspection). The feature was also built ~164 commits ago, so landing it means a real re-port onto the reworked suggestion core — which I'm happy to do, but only if it's wanted.
So before I invest in that re-port: is inline autocomplete inside terminals something you'd ever want in Cotabby?
- If yes, I'll re-port it onto current
mainand open a PR, and we can scope it (e.g. shell-integration first, TUI OCR as a follow-up). - If it's intentionally out of scope, no problem at all — I'll keep it on my fork.
Additional context
- Working implementation on my fork: https://github.com/t-h-tech/cotabby/tree/feature/terminal-shell-integration
- Separately, I'm opening a small, direction-neutral PR for the per-app shortcut overrides that came out of the same work — that one is independent of the terminal question.
- Security model: the socket is
0600and user-owned; the remote.acceptIPC path is debug-gated.
@t-h-tech
Is inline autocomplete inside terminals something you’d ever want in Cotabby?
Yes.
If you have the time, we’d appreciate it if you could re-port the implementation to the current main branch and open a PR for us to review. Starting with the shell integration and following up with the TUI OCR later sounds like a reasonable approach.
Thanks for putting this together and for checking with us before investing the effort!