Skip to content

bug: Chinese input method (fcitx5) not working on X11 #51

Description

@Zerodys

Description

Unable to switch to Chinese input method (fcitx5) in otty on X11. The input method works correctly in other terminals (e.g., Ghostty) on the same system.

Environment

  • OS: Linux Mint 22.3 (Xena), X11 session
  • otty version: 0.1.0-1
  • Input method: fcitx5 (running, XIM server registered as @server=fcitx5)
  • Windowing: winit 0.30.12 (Rust)

Root Cause Analysis

otty uses Rust's winit library for windowing. On X11, winit uses the legacy XIM (X Input Method) protocol via XOpenIM/XCreateIC/XmbLookupString instead of GTK/Qt IM modules. This is a known limitation — winit's XIM implementation has compatibility issues with fcitx5:

  1. The GTK_IM_MODULE, QT_IM_MODULE, and XMODIFIERS environment variables have no effect on winit apps, since winit bypasses these and calls Xlib's XIM directly
  2. winit's XIM preedit rendering and candidate window positioning may not work correctly with fcitx5

Evidence

  • Process environment shows correct GTK_IM_MODULE=fcitx5 and XMODIFIERS=@im=fcitx5, but these are irrelevant for winit
  • XIM_SERVERS atom correctly shows @server=fcitx5
  • winit 0.30.13 (latest stable) has no XIM/fcitx5 fixes — only macOS/Windows IME improvements
  • Other GTK-based terminals (Ghostty) work fine with fcitx5

Suggested Fix

Options:

  1. Upgrade to use a terminal library with proper fcitx5 support (e.g., libvte, alacritty's approach)
  2. Implement Wayland text-input protocol support (winit has partial zwp_text_input support which may work better)
  3. Add a config option to bypass winit's input handling and use a custom XIM implementation

Reproduction Steps

  1. Install fcitx5 and configure Chinese input (e.g., Pinyin)
  2. Launch otty on X11
  3. Try to switch to Chinese input method (Ctrl+Space or Super+Space)
  4. Chinese characters cannot be input

Workaround

Use a GTK-based terminal (Ghostty, GNOME Terminal, etc.) for Chinese input tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions