omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Ctrl+Space tmux prefix conflicts with fcitx5 input method toggle (introduced in v3.4.0)

Open hoornet opened this issue 9 months ago • 12 comments

Problem

Since v3.4.0 introduced Ctrl+Space as the default tmux prefix, users who have fcitx5 installed will find that the keybinding switches keyboard language instead of reaching tmux.

Why it happens

fcitx5 (an input method framework) intercepts Ctrl+Space system-wide by default — it's hardcoded in ~/.config/fcitx5/config under [Hotkey/TriggerKeys]. It grabs the key at the compositor level before any application (including tmux) receives it.

fcitx5 may be present on Omarchy systems even if the user never intentionally set it up, as it can be installed as a dependency.

Fix

Remove Control+space from fcitx5's trigger keys in ~/.config/fcitx5/config:

[Hotkey/TriggerKeys]
# remove the Control+space line, keep the rest:
0=Zenkaku_Hankaku
1=Hangul

Then restart fcitx5:

pkill fcitx5 && fcitx5 -d

Suggested Omarchy-side fix

  • Add a note to the tmux docs / release notes mentioning this conflict, or
  • Have the Omarchy tmux setup detect and disable the fcitx5 Ctrl+Space binding automatically (e.g. as part of a migration or install script)

edit I created this to check for binding conflicts in case it helps anyone: https://github.com/hoornet/keybind-audit

hoornet avatar Mar 01 '26 15:03 hoornet

Are you sure it's not something you previously added? I have no ~/.config/fcitx5/config file.

pomartel avatar Mar 02 '26 01:03 pomartel

@hoornet did you setup using a different KB or something when you installed? I also don't have a ~/.config/fcitx5/config file so I'm thinking somehow you wound up with this in a way I'm not recreating.

ryanrhughes avatar Mar 02 '26 04:03 ryanrhughes

I’m experiencing the same conflict with the fcitx5 input method toggle.

I’m a Chinese user using fcitx5 with Rime for Chinese input. I manage Rime settings via fcitx5-configtool and switch input methods using Ctrl + Space.

xi4oh4o avatar Mar 02 '26 06:03 xi4oh4o

If ctrl+space does not work in tmux, I think you can use ctrl+b as an alternate leader key.

pomartel avatar Mar 02 '26 11:03 pomartel

For anyone using your custom ~/.tmux.conf, I noticed that nested tmux sessions won't understand the ctrl + b + b anymore.

One alternative is just to disable the Omarchy tmux (~/.config/tmux/tmux.conf) conf and use yours (~/.tmux.conf)

mv ~/.config/tmux/tmux.conf ~/.config/tmux/tmux.conf.bak

rodolfobandeira avatar Mar 03 '26 01:03 rodolfobandeira

I vibed this if it helps : https://github.com/hoornet/keybind-audit

hoornet avatar Mar 03 '26 11:03 hoornet

@ryanrhughes yes,i added slovenian keyboard as well as us english. I believe when I was installing Omarchy it was set to Slovenian kb, the english was added after install. It's a common practice for many of us who have the OS set to english, but at the same time have to use our native language keyboard sometimes ( responding to emails etc ). I remember i set it through the default keyboard switcher which for a while remained visible in top right corner in Omarchy. Not sure anymore if I downloaded anything else additionally because it was like half a year ago...

hoornet avatar Mar 04 '26 09:03 hoornet

same problem here with altgr-int

jesalazaro avatar Apr 18 '26 21:04 jesalazaro

I hit this exact conflict on Omarchy 4.0.2 (fcitx5 5.1.21) and fixed it locally.

Root cause

fcitx5 has Control+space as a trigger hotkey by default (in ~/.config/fcitx5/config). It grabs the key at the compositor level before tmux receives it.

Fix (tested)

Change the fcitx5 trigger away from Control+space (e.g. to Control+shift+space):

mkdir -p ~/.config/fcitx5
cat > ~/.config/fcitx5/config <<'EOF'
[Hotkey/TriggerKeys]
0=Control+shift+space
1=Zenkaku_Hankaku
2=Hangul
EOF
pkill fcitx5 && fcitx5 -d

If you never use fcitx5 to switch IM, you can drop the 0= line entirely and keep only the others.

I verified the new config is loaded on restart (file mtime before process start) and tmux gets C-Space back.

Full write-up (PT-BR): https://github.com/eds-4d5/omarchy-quick-fixes

eds-4d5 avatar Sep 03 '26 20:09 eds-4d5

I reproduced this on a worker built from the Omarchy ISO (fcitx5 5.1.22, foot, tmux, with keys sent via wtype).

Why some people see it and others don't. Omarchy runs fcitx5 in every session and ships no TriggerKeys override, so fcitx5's built-in default applies, and that default includes Control+space. fcitx5 only acts on the trigger when the current input-method group has more than one entry. With the stock profile (just keyboard-us), Ctrl+Space then c opened a second tmux window. After adding a second entry (keyboard-si, as in the original report), fcitx5 took the same keypress and switched to keyboard-si, and tmux never saw it. Adding a keyboard layout or an engine like Rime through fcitx5 is what exposes the conflict. Having no ~/.config/fcitx5/config file doesn't protect you, because the default applies without it.

The fix in progress. #14433 ships a config/fcitx5/config that moves the input switch to Ctrl+Shift+Space and keeps the dedicated 全角/半角 and 한/영 keys. With that file and the same two-entry profile, Ctrl+Space reached tmux again. It applies to new installs and to anyone on the stock US profile who adds a language through omarchy setup input.

It does not change anything for people who already have more than one input method, which includes everyone on this issue. Its migration deliberately preserves existing switching keys. I ran it against a two-entry profile with no config file, and fcitx5 kept Ctrl+Space. The same holds for a user whose single-entry profile isn't the stock US one and who later adds an engine. Until then, the workaround above still applies: remove Control+space from [Hotkey/TriggerKeys] in ~/.config/fcitx5/config (or set another key in fcitx5-configtool) and restart fcitx5 with omarchy-restart-xcompose.

Codex Medium reviewed this independently from source and reached the same conclusion, including that #14433 fixes this only in part. It also pointed out the single non-US profile case. Its independence from my reasoning isn't guaranteed. I haven't marked #14433 as fixing this issue, because existing affected users would still have the conflict after it merges. Whether it should close this issue, or whether existing profiles should be migrated too, is the maintainer's decision.

omarchybot avatar Oct 07 '26 23:10 omarchybot

Coming at this from the other side: since 4.5.0, existing users who relied on Ctrl+Space as their Fcitx toggle silently lose it.

What happened. On 4.0.6 -> 4.5.0-3 (fcitx5 5.1.23, Boshiamy + Array engines, multi-entry profile), migration 1791367434.sh runs omarchy-input-method configure --defaults. Since 0cd6859 ("Keep Ctrl+Space out of Fcitx's toggles instead of probing for it"), without_ctrl_space() in default/input-methods/configure.py removes Control+space from [Hotkey/TriggerKeys] in every config. That includes existing multilingual profiles where the user chose it on purpose. Before that commit, the terminal bind checked for a Ctrl+Space toggle and stayed out of the way. #14433 had also said existing switching keys would be preserved, as noted in the bot comment above.

Re-adding Control+space to Fcitx isn't enough on its own. In a terminal, the non-consuming CTRL + SPACE "Direct input for the terminal prefix" bind immediately runs fcitx5-remote -c, which undoes the toggle. You also have to hl.unbind("CTRL + SPACE"). At least one other user hit the same thing with Mozc (write-up, Japanese).

Docs contradiction. docs/input-methods.md says "Ctrl+Space is never a Fcitx toggle: configure --defaults removes it from any TriggerKeys list", but the migration paragraph a few lines below still says it "leaves existing multilingual profiles and working trigger keys alone". The 4.5 release notes don't mention the change either.

Suggestions:

  1. Only strip Control+space on fresh/stock profiles. Preserve it where the profile already had more than one entry (the original #14433 behavior). Bring back the cheap check in the terminal bind, so it skips fcitx5-remote -c while Fcitx still toggles on Ctrl+Space.
  2. Or, if the strict policy stays, mention it in the release notes and fix the docs paragraph.

Workaround for anyone who wants Ctrl+Space for the IME and a Screen-style Ctrl+A prefix, keeping Omarchy's direct-input behavior. Put 0=Control+space back in [Hotkey/TriggerKeys] (stop omarchy-fcitx5.service first, since Fcitx rewrites its config on exit). Set prefix C-a in tmux and prefix = "ctrl+a" in Herdr. Then add this to ~/.config/hypr/bindings.lua:

hl.unbind("CTRL + SPACE")
o.bind("CTRL + A", "Direct input for the terminal prefix", function()
  local window = hl.get_active_window()
  for _, tag in ipairs(window and window.tags or {}) do
    if tag:gsub("%*$", "") == "terminal" then
      o.shell_succeeds("timeout 0.3 fcitx5-remote --check -c")
      return
    end
  end
end, { non_consuming = true })

Note that a future configure --defaults run (a migration or first-run) will strip the Fcitx key again.

COLDTURNIP avatar Nov 09 '26 02:11 COLDTURNIP

The merged version of #14433 (0b9dace01837edd87eb65f20789063abcd5cf491, shipped in v4.5.0) removes Control+space from existing Fcitx trigger lists, including multilingual profiles. configure --defaults does this before the fresh-profile check and retains the other trigger keys. This corrects my earlier comment: the shipped migration does not preserve an existing Ctrl+Space toggle. It addresses the original default conflict and explains the shortcut removal @COLDTURNIP reports.

The terminal binding also requests direct input without checking Fcitx's trigger keys, leaving both handlers on the same chord if that toggle is restored. The precise event sequence reported in #17852 has not been reproduced in this update. The migration documentation still promises to preserve working trigger keys, contradicting its shortcut paragraph and the implementation.

Codex High, Opus 5.5 High, and muse-wonder via pi (thinking high) checked the source; no new worker tests or live reproduction ran. The second reviewers agreed with these findings; their independence from my reasoning is not guaranteed. This remains open for the maintainer to decide whether existing custom Ctrl+Space toggles should be preserved or the terminal reservation retained, with documentation matching that choice.

omarchybot avatar Nov 18 '26 01:11 omarchybot