#2805·espanso

Expose the worker's expansion-enabled state in a queryable form

Author: 4rc0sCreated Sep 14, 2026Updated Sep 14, 2026

espanso currently offers no way for an external tool to learn whether text expansion is enabled — only whether the daemon is alive:

  • espanso status prints espanso is running regardless of the enabled state, and there is no flag to change what it reports.
  • espanso cmd (enable/disable/toggle/search) only sends commands.
  • The IPC protocol (espanso/src/ipc.rs, IPCEvent) has only EnableRequest/DisableRequest/ToggleRequest — no query event.

Meanwhile the information already exists in the worker: DisableMiddleware (espanso-engine/src/process/middleware/disable.rs) keeps an in-memory enabled flag and dispatches EventType::Enabled/EventType::Disabled on every change (which is what drives the tray icon), and logs each transition:

toggled enabled state, is_enabled = false

This matters for third-party UIs such as macspanso (a macOS menu-bar GUI for espanso's config files): we offer enable/disable/snooze commands next to a status header, and we can display daemon liveness but not the paused state — the most likely reason a user's snippets "stopped working".

Suggestion: expose the state in a queryable form, e.g.

  1. espanso status also reporting the paused state (e.g. expansions are disabled);
  2. a query subcommand (espanso cmd status); or
  3. a queryable IPCEvent answered with the worker's current state.

Interim workaround we ship: parsing the log line above and reconstructing the state (last toggle after the newest worker's first reading configs from: banner; the engine resets to enabled on worker start). Fragile by nature — log formats are not contracts — which is why a supported query would be welcome.

Verified against espanso 2.4.1 (macOS).