Skip to content

Leave Ctrl+Space to tmux and herdr when fcitx5 switches input methods - #14401

Closed
seunghan91 wants to merge 1 commit into
omacom:quattrofrom
seunghan91:fcitx5-trigger-keys
Closed

seunghan91 wants to merge 1 commit into
omacom:quattrofrom
seunghan91:fcitx5-trigger-keys

Conversation

@seunghan91

Copy link
Copy Markdown

Reference implementation of option 3 in #14400, opened as a draft so the discussion has a diff to look at. If you'd rather go another way there, I'll close this or rework it.

fcitx5 switches input methods on Ctrl+Space by default, which is also Omarchy's tmux and herdr prefix (config/tmux/tmux.conf:2, config/herdr/config.toml:18). Nothing notices while a single input method is configured, because fcitx5's trigger does nothing then. As soon as someone adds a second one, through the manual's fcitx5-configtool route or one of the open one-step setups (#11719, #9634, #12312), fcitx5 takes the chord before the terminal sees it.

What changes

File Change
config/fcitx5/config New. [Hotkey/TriggerKeys] is Zenkaku_Hankaku and Hangul, the dedicated 全角/半角 and 한/영 keys, and leaves out Control+space. omarchy-settings seeds it to /etc/skel for new users.
migrations/1791210803.sh For an existing user, seeds the same file only when there is no ~/.config/fcitx5/config and every group in the profile has a single item. In that state the trigger does nothing today, so no one's working switching key changes. A running fcitx5 is reloaded with fcitx5-remote -r; otherwise fcitx5-configtool would save the old in-memory keys back over the file. If the reload fails, the file is removed and the migration stays pending.
bin/omarchy-upgrade-to-quattro copy_missing_config_defaults skips fcitx5/config. The upgrade runs migrations afterwards, so the migration's profile check still applies.
manual/34-keyboard-mouse-trackpad.md One sentence: the 全角/半角 / 한/영 keys switch out of the box; Ctrl+Space is left for tmux and herdr.
test/shell.d/fcitx5-trigger-keys-migration-test.sh The shipped list, the tmux/herdr prefixes it protects, seeding with and without a profile, an existing config, a symlinked config, a multilingual profile, a failed reload then retry, and the upgrade path deferring to the migration.

Deliberately not included: a fallback key for keyboards without 全角/半角 or 한/영. That's the open question in #14400. Until it's settled, those users pick a key in fcitx5-configtool, as the manual already says.

Downstream note

Try Omarchy's guest builds from these packages and seeds its own fcitx5 profile with a second input method (Chewing, plus Korean in omacom/try-omarchy#320). Its README documents Ctrl+Space for them. Existing guests are untouched, because their profiles already have two items. A guest factory built after this lands would need to ship its own trigger keys or update that README. I'm happy to send that change there.

Testing

  • test/shell.d/fcitx5-trigger-keys-migration-test.sh passes on Arch Linux ARM with bash 5.
  • ./test/all has the same failures as quattro (81145eb), all environment-related (no node, updatedb or omarchy-pkgs checkout), plus the 6 new passing tests.
  • Through a real compositor, with fcitx5 5.1.23 and fcitx5-hangul 5.1.11: headless sway 1.12 → fcitx5 over input-method-v2 → foot → tmux with the C-Space prefix, keys sent with wtype. An existing user has fcitx5 running and one input method, then adds hangul the way Add one-step Korean input setup #11719 does (D-Bus group rewrite, triggers untouched):
tmux windows after Ctrl+Space, c then gksrmf␣ after the 한/영 key
quattro 1: fcitx5 took the chord the c is typed as ㅊ 한글
this branch (migration ran while fcitx5 was up) 2: prefix reached tmux still keyboard-us 한글

sway stands in for Hyprland, which has no headless backend, and the keyboard is virtual. I'll repeat this on a clean x86 install with a physical Korean keyboard.

Written and tested with help from Claude (an Anthropic AI model).

fcitx5 switches input methods on Ctrl+Space by default, which is also the
tmux and herdr prefix. Nothing notices while a single input method is
configured, but as soon as someone adds a second one, fcitx5 takes the
chord before the terminal sees it.

Ship a fcitx5 config whose trigger keys are the dedicated 全角/半角 and
한/영 keys. New users get it through /etc/skel. Existing users get it
from a migration only when they have no fcitx5 config and a single input
method, where the trigger does nothing yet, so nobody's working
switching key changes; a running fcitx5 is reloaded so
fcitx5-configtool does not write the old keys back. The quattro upgrade
leaves this file to the migration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019giKJAi15aAheoMjWCsizr
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for putting a concrete diff behind #14400. Heads-up: #14433 (from @dhh) also adds config/fcitx5/config, with Control+Shift+space, Zenkaku_Hankaku, and Hangul as trigger keys, which leaves Ctrl+Space to tmux and herdr. That likely supersedes this PR. Your migration's "only seed when the profile has a single input method" safeguard is still worth raising on #14433, since its migration runs omarchy-input-method configure --defaults for everyone.

Also, if this does go forward: migrations/1791210803.sh is also added by #14408 and #14410, so it needs a fresh timestamp.

@dhh dhh closed this Oct 7, 2026
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.

3 participants