Skip to content

Feature request: optional 'query' field in Unix socket protocol for pre-filled search #10

Description

@jellydn

What

The Unix socket daemon protocol currently accepts only:

{ "cmd": "open_path", "path": "/some/dir", "in_grep": false }

There is no way to pass a pre-filled search query — no query, filter, or constraint field.

Why

This forces integrations (like vscode-fff-gpui) down a suboptimal path:

  1. Type-filtered search — To open the picker scoped to e.g. only TypeScript files, the integration must shell out to rg --files --type ts, create a temp directory with symlinks to the filtered files, then send open_path pointing at that temp dir. This adds an external dependency (ripgrep), temp-file overhead, and complexity.

  2. Pre-filled grep — To implement a "Find TODO/FIXME" shortcut, the integration must run git grep -lE '(TODO|FIXME)' first, create another overlay, and open that. The user can't just land in grep mode with TODO already typed in the search bar.

  3. Resume with state — Integrations can track "last search kind" in-memory, but can't restore the user's actual search query — only the mode (files vs grep).

The daemon already has all the capabilities internally — fff-search supports glob patterns (**/*.rs), git-status filtering (git:modified), exclusion (!node_modules), and full grep with plain/regex/fuzzy modes. The problem is purely that the socket protocol can't pass a query in.

How

Add an optional query field to the open_path command:

{
  "cmd": "open_path",
  "path": "/my/project",
  "in_grep": true,
  "query": "TODO|FIXME"
}
{
  "cmd": "open_path",
  "path": "/my/project",
  "in_grep": false,
  "query": "**/*.{ts,tsx} git:modified"
}

When query is present, the daemon would pre-fill the search bar with the given text so the user lands in a ready-to-navigate state. If absent, behavior is unchanged (empty search bar, as today).

This is a minimal, backward-compatible addition — any existing client that doesn't send query works exactly as before.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions