[OneDev #37] Espanso corrupts agent terminal sends (C:\tmp\ → C:\Users\Joseph\.agents\mp\, PowerShell snippet expansion) #2

Open
opened 2026-05-24 04:46:35 +00:00 by joseph · 0 comments
Owner

Imported from OneDev issue #37 (id 35582)
Original project: internal-joseph
Original state: Open
Original submitterId: 5
Original submitDate: 2026-05-08T16:05:08.554+00:00
Original lastActivity: {'date': '2026-05-08T16:05:08.554+00:00', 'description': 'opened', 'userId': 5}

Original fields:

  • Type: New Feature
  • Priority: Normal
  • Assignees: None

Symptom

When Claude Code (or any tool driving a PTY) sends commands into a PowerShell session, espanso intercepts and rewrites the input mid-stream. Two reproductions seen during the 2026-05-08 handoff-skill session:

  1. Path rewrite: C:\tmp\foo.ps1C:\Users\Joseph\.agents\mp\foo.ps1 (consistent; trigger appears to be C:\tmp\).
  2. Command snippet expansion: typing $env:Path = "$env:USERPROFILE\scoop\shims;$env:Path" triggered injection of an unrelated multi-line Start-Process cdb.exe ... command (a memory-dump debugging snippet that lives in espanso config).

Both happen inside ghst PTY sessions and the live Tabby PowerShell — so it's espanso, not ghst.

Impact

  • ghst-driven automation (chezmoi apply, scripted repro) becomes unreliable: commands mutate before the shell parses them.
  • Diagnosis is non-obvious: looks like PTY corruption / shell weirdness until you notice the literal expansion target.
  • Workaround during the session was to write helper scripts to ~/<name>.ps1 (avoids C:\tmp\ trigger) and avoid certain literal command strings.

Likely cause

Espanso matches its triggers regardless of source — keyboard, paste, programmatic stdin into a focused window. Triggers configured for interactive convenience fire on agent-driven input too.

References from memory:

  • project_espanso_setup.md — Espanso replaced BeefText 2026-05-01
  • feedback_espanso_gotchas.md — v2 gotchas already known

Asks

  1. Audit AppData/Roaming/espanso/ config for triggers that match common agent inputs (C:\tmp\, $env:Path = ..., etc.).
  2. Decide policy: scope espanso to specific apps (exclude pwsh.exe / Tabby / ghst PTYs), prefix all triggers with a non-typeable lead char, or disable globally during agent sessions.
  3. Update feedback_espanso_gotchas.md (or split a new memory) once the fix is chosen so future agents know the failure shape.

Repro

In any pwsh.exe focused window, type literally C:\tmp\test.ps1 and observe expansion. Same for the $env:Path = "...scoop\shims..." string captured above.

Imported from OneDev issue #37 (id 35582) Original project: internal-joseph Original state: Open Original submitterId: 5 Original submitDate: 2026-05-08T16:05:08.554+00:00 Original lastActivity: {'date': '2026-05-08T16:05:08.554+00:00', 'description': 'opened', 'userId': 5} Original fields: - Type: New Feature - Priority: Normal - Assignees: None ## Symptom When Claude Code (or any tool driving a PTY) sends commands into a PowerShell session, espanso intercepts and rewrites the input mid-stream. Two reproductions seen during the 2026-05-08 handoff-skill session: 1. **Path rewrite**: `C:\tmp\foo.ps1` → `C:\Users\Joseph\.agents\mp\foo.ps1` (consistent; trigger appears to be `C:\tmp\`). 2. **Command snippet expansion**: typing `$env:Path = "$env:USERPROFILE\scoop\shims;$env:Path"` triggered injection of an unrelated multi-line `Start-Process cdb.exe ...` command (a memory-dump debugging snippet that lives in espanso config). Both happen inside ghst PTY sessions and the live Tabby PowerShell — so it's espanso, not ghst. ## Impact - ghst-driven automation (chezmoi apply, scripted repro) becomes unreliable: commands mutate before the shell parses them. - Diagnosis is non-obvious: looks like PTY corruption / shell weirdness until you notice the literal expansion target. - Workaround during the session was to write helper scripts to `~/<name>.ps1` (avoids `C:\tmp\` trigger) and avoid certain literal command strings. ## Likely cause Espanso matches its triggers regardless of source — keyboard, paste, programmatic stdin into a focused window. Triggers configured for interactive convenience fire on agent-driven input too. References from memory: - `project_espanso_setup.md` — Espanso replaced BeefText 2026-05-01 - `feedback_espanso_gotchas.md` — v2 gotchas already known ## Asks 1. Audit `AppData/Roaming/espanso/` config for triggers that match common agent inputs (`C:\tmp\`, `$env:Path = ...`, etc.). 2. Decide policy: scope espanso to specific apps (exclude pwsh.exe / Tabby / ghst PTYs), prefix all triggers with a non-typeable lead char, or disable globally during agent sessions. 3. Update `feedback_espanso_gotchas.md` (or split a new memory) once the fix is chosen so future agents know the failure shape. ## Repro In any pwsh.exe focused window, type literally `C:\tmp\test.ps1` and observe expansion. Same for the `$env:Path = "...scoop\shims..."` string captured above.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joseph/internal-joseph#2
No description provided.