When espanso breaks on long replacement strings (and how to fix it)
Source: Dev.to
TL;DR ☕
If a replacement string longer than 100 characters isn’t expanding, increase clipboard_threshold in ~/.config/espanso/default.yml.
The problem
Long replacement strings ( > 100 chars) can silently fail in Espanso.
Example snippet:
- trigger: ":some-long-snippet"
replace: "Dear passangers, we have good news and bad news. Good news is we are landing. Bad news is we are crash landing!"
When the trigger is typed, nothing is inserted and sometimes a command‑prompt‑like UI appears.
Why it happens
Espanso’s default configuration contains a clipboard_threshold setting (commented out):
# clipboard_threshold: 100
If the replacement text exceeds this threshold, Espanso aborts the insertion without warning.
How to fix it
-
Open the configuration file:
nano ~/.config/espanso/default.yml -
Uncomment (or add) the
clipboard_thresholdline and set it to a higher value, e.g. 500:clipboard_threshold: 500 -
Save the file and reload Espanso (or restart it manually):
espanso restart
After restarting, long replacements work as expected.
Additional notes
- This issue is not platform‑specific; it occurs on macOS, Linux, and Windows alike.
- For a quick introduction to Espanso, see the post “Espanso: Because Who Actually Likes Typing Out Their Emails?” (link placeholder).
Happy expanding!