Skip to content

Fix empty triggers causing expansion on every word separator (#1616) - #2508

Merged
AucaCoyan merged 3 commits into
espanso:devfrom
gcailly:fix-empty-trigger-1616
Oct 5, 2025
Merged

AucaCoyan merged 3 commits into
espanso:devfrom
gcailly:fix-empty-trigger-1616

Conversation

@gcailly

@gcailly gcailly commented Oct 5, 2025

Copy link
Copy Markdown
Contributor

When a trigger was set to an empty string (""), it would expand on every word separator, causing unexpected text replacements.

Now empty triggers are filtered out during configuration parsing, and a warning is displayed in the logs to inform that empty triggers are not allowed and have been ignored.

Fixes #1616

…panso#2483)

When running commands like `espanso service --help` or `espanso package --help`,
the CLI was displaying the main application help instead of the specific
subcommand help.

This was caused by using `clap_instance.print_help()` which always prints
the root command help, instead of using `err.exit()` which properly handles
contextual help for subcommands.

Fix: Use `err.exit()` to let Clap handle contextual help display.

Fixes espanso#2483
…#1616)

When a trigger was set to an empty string (""), it would expand on every
word separator, causing unexpected text replacements.

Now empty triggers are filtered out during configuration parsing, and a
warning is displayed to inform the user that empty triggers are not allowed
and have been ignored.

This prevents the buggy behavior while giving clear feedback to users who
might have accidentally left triggers empty or were trying to disable
specific matches.

Fixes espanso#1616
@gcailly
gcailly requested a review from AucaCoyan as a code owner October 5, 2025 19:47
@AucaCoyan

Copy link
Copy Markdown
Collaborator

You sir are lit this weekend 🔥 🔥
This is also great code!

@AucaCoyan
AucaCoyan merged commit f960a81 into espanso:dev Oct 5, 2025
@gcailly

gcailly commented Oct 6, 2025

Copy link
Copy Markdown
Contributor Author

To be honest, I have only some lower-intermediate Python knowledge and I don’t know Rust, so my skills are quite limited.
I mainly use Claude Code, and I try to be careful, checking the documentation and testing things.
I love Espanso, and I’d be very happy if I could help you, for example by fixing some bugs or reducing the number of open issues. I currently have some time to do this. 🙂

@AucaCoyan

Copy link
Copy Markdown
Collaborator

Don't worry! I accept contributions of all levels. So far you did great! doesn't matter from what the tooling.

If you are interested in rust, there is no better place than the rust book. There aren't even better paid courses!

sboldt1978 pushed a commit to sboldt1978/espanso that referenced this pull request Feb 11, 2026
…#1616) (espanso#2508)

* Fix subcommand help displaying main help instead of specific help (espanso#2483)

When running commands like `espanso service --help` or `espanso package --help`,
the CLI was displaying the main application help instead of the specific
subcommand help.

This was caused by using `clap_instance.print_help()` which always prints
the root command help, instead of using `err.exit()` which properly handles
contextual help for subcommands.

Fix: Use `err.exit()` to let Clap handle contextual help display.

Fixes espanso#2483

* Fix empty triggers causing expansion on every word separator (espanso#1616)

When a trigger was set to an empty string (""), it would expand on every
word separator, causing unexpected text replacements.

Now empty triggers are filtered out during configuration parsing, and a
warning is displayed to inform the user that empty triggers are not allowed
and have been ignored.

This prevents the buggy behavior while giving clear feedback to users who
might have accidentally left triggers empty or were trying to disable
specific matches.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty trigger expands on word_separator

2 participants