alacritty: thread 'main' panicked at 'XOpenIM failed'

Which operating system does the issue occur on? Linux gurdit-lp 4.9.31-1-MANJARO #1 SMP PREEMPT Wed Jun 7 19:39:15 UTC 2017 x86_64 GNU/Linux

If on linux, are you using X11 or Wayland? X11

I followed the installation instruction of arch linux as specified in the readme. The installation completed with no errors. But when I try to execute alacritty from my old terminal. I get this error

thread 'main' panicked at 'XOpenIM failed', /home/gurditsbedi/.cargo/registry/src/
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Now I run again alacritty after executing export RUST_BACKTRACE=1 and I get this.

thread 'main' panicked at 'XOpenIM failed', /home/gurditsbedi/.cargo/registry/src/
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: __libc_start_main
  13: <unknown>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 22 (5 by maintainers)

Most upvoted comments

this can be worked around by setting LANG=en_US.UTF-8

I confirm that sudo apt install fcitx-bin && fcitx can fix the problem right away. I am running Ubuntu 17.10 with XMonad. This issue only happened when I login XMonad after logout Gnome tho…

I’ve filed a PR to winit: It uses the workaround proposed by @jwilm from

Anything that helps to fix this issue for good is welcome!

Well, geeze, it’s been a while. For now, everything should work on this branch:

glutin 0.14.0 has been released, which uses winit 0.12.0. This includes @hcpl’s tomaka/winit#424, meaning this issue (and #701) should no longer be a problem.

Additionally, tomaka/winit#451 isn’t released yet, but it will further assure that there aren’t issues with XIM. When that’s released, platform_window_init can be completely removed, and the panic caused by failing to open any input method is much more verbose and includes diagnostic information (however, it seems quite unlikely it would fail now).

Not just installing. After rebooting I have to call fcitx again. Otherwise this error appears again.

This bug is terrible for me. Somehow installing fcitx messed my keyboard config in general as it seems. Now I always have to call fcitx. Otherwise my keyboard settings are wrong. So if someone does not have fcitx installed and is planning to install it to fix this alacritty issue: use rather another terminal.

I have the same problem on Ubuntu 17.10 with KDE/Plasma and a valid locale en_US.UTF-8:

❯ RUST_BACKTRACE=1 alacritty
thread 'main' panicked at 'XOpenIM failed', /home/user/.cargo/registry/src/
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/
   1: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/
             at /checkout/src/libstd/sys_common/
             at /checkout/src/libstd/
   2: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/
             at /checkout/src/libstd/
   3: std::panicking::begin_panic
             at /checkout/src/libstd/
   4: winit::platform::platform::x11::Window2::new
             at /home/user/.cargo/registry/src/
   5: winit::window::<impl winit::WindowBuilder>::build
             at /home/user/.cargo/registry/src/
             at /home/user/.cargo/registry/src/
   6: glutin::platform::platform::x11::Context::new
             at /home/user/.cargo/registry/src/
   7: alacritty::window::Window::new
             at /home/user/.cargo/registry/src/
   8: alacritty::display::Display::new
             at src/
   9: alacritty::run
             at src/
  10: alacritty::main
             at src/
  11: main
  12: __libc_start_main
  13: _start

Sergei’s workaround solved the issue for me as well (sudo apt install fcitx-bin && fcitx)

@farid-fari not yet. tomaka/winit#468

Note that after that merges, you’ll still be waiting for a new glutin release that uses that winit release, though it should be fairly speedy. I’ll probably make a PR here when that happens, since it will include a (minor) breaking API change.

FYI, I’m running on Fedora 25 with non-DE environment (i3wm) and solved the problem by running fcitx (got idea from

This is related to this bug:

I solved it by setting a default input method using im-config and setting it to iBus this command writes a ~/.xinputrc that contains:

run_im ibus

then I restarted X11 and now alacritty launches with no problem.