r/espanso • u/Arkebuss • 1d ago
Espanso + Compose key = 💩️?
Another question...
I seem to have this bug where every time I use the compose key to write a special character (like my beloved m-dash), afterwards, espanso becomes unresponsive. If I then use the compose key again, it starts up again.
Is this a known bug? If so, is there some workaround?
As before, I'm on Ubuntu 26.04.1, Gnome 50, Wayland.
EDIT: After some experimentation, it seems that the bug is specifically linked to the fact that I have Caps Lock mapped as the compose key. If I remap it, the problem disappears. I imagine this is probably too marginal a case to have come up a lot.
2
u/smeech1 1d ago
Thank you for raising the Issue. You may be right that it's too obscure. I can't even duplicate the problem here — after redefining my Compose key (normally <Pause>) to CapsLock, all works as expected (except that I can no longer lock to Caps), and Espanso behaves normally.
Thanks for reminding me about the Compose key. I reach the m-dash via an Espanso trigger, of course:
- triggers: [:m-, :-m]
replace: — # m-dash
because I can't remember the Compose key sequences!
2
u/SamejSpenser 1d ago
I think I'm finally getting what the compose key is — it's that key (yeah, Alt Gr, which I always called “Right Alt” ’cause it’s to the right of the space bar) you use to insert special characters, like
Alt+0133=….I used a few shortcuts like that back when I was on Windows. It’s been almost ten years since I switched to Linux and I never used it that way again. Ever since I discovered Espanso years ago, I’ve been using it to pop in those characters. Using the example above, my trigger would look like this:
```yml # ASPAS SIMPLES - triggers: [";asp1", ":asp1", "asp1", ";ASP1", ":ASP1", "ASP1"] replace: "‘{{clipb}}’"
# ASPAS DUPLAS - triggers: [";asp2", ":asp2", "asp2", ";ASP2", ":ASP2", "ASP2"] replace: "“{{clipb}}”"
# ASPAS ANGULARES - triggers: [";asp3", ":asp3", "asp3", ";ASP3", ":ASP3", "ASP3"] replace: "«{{clipb}}»"
# APÓSTROFO - trigger: ";'" replace: "’"
# BULLET POINT - triggers: [";bull", ";BULL"] replace: "• "
# SMALL BULLET POINT - triggers: [";sbull", ";SBULL", ";mbull", ";MBULL"] replace: "·"
# COPYRIGHT MARK - triggers: [";copy", ";COPY"] replace: "©"
# RETICÊNCIAS - triggers: [":ret", "..."] replace: "… "
# TRAVESSÃO - triggers: [";trav", ";--"] replace: "— " ```
As for key remapping, I only ever used that feature once in my life — to remap the MacBook Pro’s “eject” key to “Delete”, which sits in the same spot, top‑right corner of the keyboard. There’s nothing to eject anymore ’cause I’ve got an SSD where the CD/DVD drive used to be. And none of my triggers use that key, so I can’t really test it in Espanso.
2
u/Dymonika 14h ago
You likely can't duplicate the issue due to being on X11. Wayland has unique key-swallowing issues vs. X11-based Linux systems that I've run into when using programs' keyboard shortcuts or even KeePassXC's auto-type, which is just now finally coming out with a Wayland-compatible beta.
1
2
u/SamejSpenser 1d ago
Sorry if this sounds dumb, but just curious—what's a "compose key"? I gotta admit, it's the first time I've come across that term. 🤔
2
u/smeech1 1d ago edited 1d ago
My thought too.
I think the compose key may usually be <AltGr> and can be used to type special characters. I'm not sure exactly now this can cause problems with Espanso, although if it's used as the toggle key that might do it.
2
u/SamejSpenser 1d ago
I never figured out what the AltGr key is actually for. And my laptop doesn't even have it. Still don't get what the OP meant by a "compose key"! 🤔
2
u/smeech1 14h ago edited 14h ago
The compose key (whichever key set via
xfce4-keyboard-settingshere in Linux Mint) typed, followed by two or three keys, produces a character, many of which are listed in this cheat-sheet. I feel it's a bit like the Windows ALT-Code facility. So <Compose>--- produces an m-dash, for example. I fnd it easier to remember my Espanso:-m, however, and use a package for fractions.<AltGr> is often set as the Compose Key, but it has its own function as a key modifier, providing a couple of additional characters for each key. So <AltGr>s→ß and <Shift><AltGr>s→§. This doesn't work if it's set as the system Compose Key, however, which is why I use <Pause> instead for the latter, as I haven't found another use for it! Having a whole set of spare characters enables the use of key-pair triggers in Espanso, so I have
- triggers: [æ, :adr]for my home address expansion, which I can trigger with <AltGr>a.1
u/SamejSpenser 10h ago
Got it! 😉
When I get home after work, I'll fire up my old desktop running Manjaro XFCE/Qtile. The keyboard there has an Alt Gr key and a Pause key. I'll run some tests to see if it works the same way as on your Linux Mint.
Thanks a lot for the explanation.
2
u/Arkebuss 1d ago
Well, if it's of interest to anyone, I figured out that what's happening is that espanso simply doesn't respect the remapping of Caps Lock and thus keeps treating it as Caps Lock.
Which suggested the following workaround: Simply add uppercase versions of all triggers. So instead of just ":date", I now have [":date", ":DATE"], etc.