Skip to content

Bring Japanese input to existing VMs - #354

Merged
themartiano merged 5 commits into
mainfrom
japanese-input-migration
Oct 15, 2026
Merged

themartiano merged 5 commits into
mainfrom
japanese-input-migration

Conversation

@themartiano

Copy link
Copy Markdown
Collaborator

What changed and why

Brings Japanese input (Fcitx5 + Mozc, JIS č‹ąæ•°/かお keys) to VMs created before v0.6.0, through the Update and Launch boot migration.

  • Keyboard support is automatic. ANSI/ISO/JIS keyboard support (apple-keyboard-input.lua) is installed on every boot, even after Skip and Launch. It needs no packages or network.
  • Japanese input is part of Update and Launch (catalog japanese-input revision 3):
    • It installs only the missing factory packages: fcitx5, fcitx5-mozc, fcitx5-gtk, fcitx5-qt, fcitx5-configtool and noto-fonts-cjk.
    • It uses pacman -Sy --needed and checks pacman's local database. It no longer runs a full -Syu system upgrade, because the consent dialog is all-or-nothing and every older VM would otherwise get a system upgrade at boot.
    • v0.5 VMs get Mozc and the configuration tool. v0.4 VMs also get the GTK/Qt input modules and CJK fonts.
  • Stock Fcitx profiles are migrated:
    • Mozc goes first on JIS Macs, for a Japanese VM language, or when the Mac's primary language is Japanese.
    • Older VMs keep an English locale, so the app now passes tryomarchy.mac_language= as a separate hint. It never changes LANG.
    • When Mozc goes first, the Fcitx keyboard follows XKBLAYOUT from /etc/vconsole.conf, as on new VMs. Mozc picks its kana table from that layout, so this fixes ろ/ÂĨ in kana input for older VMs with the jp layout.
    • Personal profiles, shortcuts and Korean group selection are preserved.
  • Unrelated, also on this branch: 5c4ccb6 makes provenance check each backported file against the last backport that touches it.

Known trade-off: -Sy without -u is a partial upgrade. A refresh is needed because Arch Linux ARM mirrors drop superseded packages. Pacman blocks broken dependency cases, but a newly built package needing a newer library than the VM has remains a small risk that grows as older VMs age.

Testing

  • make test: exit 0. That covers 423 guest Python tests, 452 Swift tests (89 suites) and run-qemu-ssh-contract.test.

  • New tests cover:

    • detecting missing packages and the exact pacman command;
    • matching the kana layout, including the Korean seed and repeat runs;
    • the Mac language hint on ANSI/ISO;
    • parsing /etc/vconsole.conf;
    • adding, omitting and rejecting the launcher token;
    • Swift language plumbing.
  • Checked against upstream sources:

    • Fcitx5 5.1.23: ConsumeRedundantActivateKeys, the default trigger keys, and Wayland keymap handling.
    • fcitx5-mozc: kana table selection by layout.
    • xkeyboard-config: Hangul/Hangul_Hanja and apple:jp_oadg109a.
    • Pinned Omarchy: Hyprland reads XKBLAYOUT.
  • Not tested on a running VM. Before release: copy a v0.5.1 VM, set the app's language to Japanese, then run Update and Launch. Confirm that:

    • only the missing packages install;
    • Ctrl+Space turns on Mozc;
    • with XKBLAYOUT=jp the profile lists keyboard-jp, mozc, chewing;
    • kana input works.

    Physical JIS č‹ąæ•°/かお still needs a JIS Mac, or QMP lang1/lang2 events.

ðŸĪ– Generated with Claude Code

https://claude.ai/code/session_015UqPgfcQhiCHGdfjQts5AY

@themartiano
themartiano merged commit 546ecdd into main Oct 15, 2026
4 checks passed
@themartiano
themartiano deleted the japanese-input-migration branch October 15, 2026 03:52
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.

1 participant