Skip to content

[Feature] Inline autocomplete inside terminals (shell-hook IPC + Claude Code TUI OCR) #762

Description

@t-h-tech

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 a 0600, 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 Skip ghost text in VS Code / Cursor integrated terminals #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 main and 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 0600 and user-owned; the remote .accept IPC path is debug-gated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions