0

I tried adding this compose key sequence to my ~/.XCompose:

<Multi_key> <L> <L> : "Λ" U039B # GREEK CAPITAL LETTER LAMDA

I then tried to use this in a few places, but the sequence would never terminate. That is, the prompt indicates that I'm not done typing the full compose key sequence, even though it's already shown:

prompt and unfinished compose key sequence

The above is from GNOME Console, which shows an underscore under the current character while typing a compose key.

It seems the underlying issue is that the compose key sequence above is a prefix for another compose key in [X11 library root]/share/X11/locale/en_US.UTF-8/Compose:

<Multi_key> <L> <L> <A> <P>     : "🖖"  U1F596 # RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS

How do I tell the application to end a compose key if it's the prefix of another compose key? Is this even possible, or do all compose keys have to avoid being prefixes for all others? Pressing the compose key again (Caps Lock in my case) did not help, and pressing Esc just cancels the compose key.

2 Answers 2

2
+100

I think the answer is: "that's not supported" (as far as I can tell). But I put a workaround, at the bottom of this answer.

See this open issue: https://github.com/samhocevar/wincompose/issues/242 ­— that's discussing a windows port, but X11 behavior is mentioned, too.

... the behavior is “whatever the underlying trie implementation does” without particular regard for consistency.

This other question touches on the issue, too. The validator there gives warnings when you use a prefix of an existing sequence.

As far as I understand, there is no input key that says "stop interpreting my input, and use what I've given so far." I wish there were, too.

However, if you like the Esc key you mentioned, you could always just add that to your sequence, manually.

ie:

<Multi_key> <L> <L> <Escape> : "Λ" U039B # GREEK CAPITAL LETTER LAMDA

Note: it must be spelled exactly Escape for me — not escape or Esc. See output of xev on your system.

-1

As soon as you type anything that is not also part of a compatible compose sequence, the desired characters will be input. So if you type Compose,L,L,3 the input you see should be Λ3 for instance.

2
  • No, that is just not the case. I've tested in two applications, GNOME Console and JetBrains IDEA, and neither work like this. In Console I get a bell sound every time I press another key, and the display doesn't change at all. In IDEA it shows no indication of anything happening, but just exits the compose "mode" without printing anything after pressing the third key after the compose key.
    – l0b0
    Commented Oct 7, 2023 at 2:42
  • That is fascinating to read and counter to my existing and previous implementations of using a .XCompose-driven Compose key configuration. I do not know why your system is behaving as you describe, but I cannot replicate.
    – DopeGhoti
    Commented Oct 7, 2023 at 3:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .