Fixed the issue of rime-ice failing to display the candidate box
Chinese input in Linux is a perennial problem, and I've written many articles about it. Since the newer versions of Chromium and Electron, I haven't encountered the inability to input Chinese for a long time.
However, recently I suddenly discovered that I couldn't type Chinese while playing Dota 2 at home (the candidate list wouldn't pop up!). The problem persisted even when switching to the terminal with Ghostty, Firefox, and Obsidian. In one game, my teammate picked Nyx Assassin, reached level 6, didn't gank, and instead stayed in lane, hogging resources meant for my carry, Anti-Mage. I was frustrated because I couldn't type Chinese (I could only type Pinyin).
After the game, I quickly troubleshooted and recorded the process below, hoping it can help more people.
Initially, I thought it was a problem with switching between Chinese and English, but that wasn't the case. The waybar showed the status switching was normal, and manually switching with the mouse didn't solve the problem.
1. Troubleshooting with Debug Mode
First, kill the input method process pkill fcitx5, then run debug mode:
1fcitx5 --verbose 5
5 stands for debug. fcitx5 --help will provide relevant information. Without debug mode, you're basically just groping in the dark! In fact, for similar problems in the future, I highly recommend enabling debug logging.
In my case, I knew that with so many software programs having problems simultaneously, the issue was definitely with the input method itself, and not related to the upper-level software (the troubleshooting process for Linux Chinese input is quite long; you can refer to my previous articles if you're interested).
At this point, an error will be triggered, and the following error log will be output:
1E20260326 13:45:19.376029 140583420058240 lua_gears.cc:83] Lua Compoment of autoload error:( module: *search name_space: radical_pinyin status: 2 ): error loading module 'search' from file '/usr/share/rime-data/lua/search.lua':
2
3/usr/share/rime-data/lua/search.lua:24: attempt to assign to const variable 'i'
4E20260326 13:45:19.376039 140583420058240 lua_gears.cc:131] Lua Compoment of initialize error:( module: *search name_space: radical_pinyin func type: string ): func type error expect function
5E20260326 13:45:19.640052 140583420058240 lua_gears.cc:17] LuaTranslation::Next error(2): [string "table.unpack = table.unpack or unpack..."]:4: attempt to call a string value (upvalue 'f')
6E20260326 13:45:19.775707 140583420058240 lua_gears.cc:17] LuaTranslation::Next error(2): [string "table.unpack = table.unpack or unpack..."]:4: attempt to call a string value (upvalue 'f')
7E20260326 13:45:21.215213 140583420058240 lua_gears.cc:17] LuaTranslation::Next error(2): [string "table.unpack = table.unpack or unpack..."]:4: attempt to call a string value (upvalue 'f')
At this point, the problem is clear.
/usr/share/rime-data/lua/search.lua:24: attempt to assign to const variable 'i' In newer versions of Lua, 5.4 and above, the loop variable i defined in for i=1,n do is a constant and cannot be reassigned inside the loop.
1local function get_pos( text, char )
2 local pos = {}
3 if text:find( char ) then
4 local tmp = text
5 for i = 1, utf8.len( tmp ) do
6 local first_char = tmp:sub( 1, utf8.offset( tmp, 2 ) - 1 )
7 if first_char == char then pos[i] = true end
8 tmp = tmp:gsub( '^' .. first_char, '' )
9 i = i + 1 -- error here
10 end
11 end
12 return pos
13end
Simply commenting out the code block i = i + 1 in the above search.lua code will solve the problem.
Or
1for i = 1, #list do
2 local j = i -- Use the new variable j to replace i in the operation
3 j = j + 1 -- Modify variable j, without touching the loop variable i
4end
Screenshot example:

After saving, restart with fcitx5 -rd, and the problem should be fixed.
2. How did this problem occur?
It's highly likely because the fcitx5-lua package in Arch Linux was updated in the UTC package on 2026-03-23 15:27, upgrading Lua. The Lua version calling logic within it wasn't investigated, and there wasn't enough time.
1➜ ~ paru -Ql rime-ice-pinyin-git | grep search
2rime-ice-pinyin-git /usr/share/rime-data/lua/search.lua
The output above shows that the problematic code search.lua comes from rime-ice-pinyin-git.
Checking the rime-ice source code reveals that this issue (https://github.com/iDvel/rime-ice/issues/1502) has already been reported on macOS and has been merged and fixed.
Unfortunately, the rime-ice-pinyin-git repository in the AUR repository has not been updated in time (Last Updated: 2025-10-31 20:42 (UTC)), thus triggering the issue.
The original source of rime-ice's search.lua is https://github.com/mirtlecn/rime-radical-pinyin. The specific function of rime-radical-pinyin can be found in its repository documentation. (The commit history of this repository also shows that the issue has been fixed.)
Summary of the error chain:
Lua upgrade --> search.lua syntax error --> rime-ice fails to display candidate boxes
The upstream was fixed, but the downstream packages hadn't been updated yet. Without updated packages, users suffer. They have to locate and fix the problem themselves. I also fixed it first and then researched to sort out the situation.
3. Summary
This problem can seem minor, as it's just that the AUR package hasn't been updated yet. But it can also be significant; Chinese users can't even input Chinese characters, so what's the point?! Who can be blamed? This is the daily life of Linux users: encountering problems and figuring them out yourself, and sometimes even learning some strange knowledge 😅. Perhaps the person maintaining the rime-ice-pinyin-git package is too busy raising children to manage it all, and it's worth noting that most package maintainers dedicate themselves selflessly and for free.
Documenting and publishing this article has also taken me a considerable amount of time, but I hope it can help more people. For example, if they encounter other Fcitx5 issues in the future, they can learn from this experience, enable debug mode, and accurately locate the problem.
Copyright statement:
- All content that is not sourced is original., please do not reprint without authorization (because the typesetting is often disordered after reprinting, the content is uncontrollable, and cannot be continuously updated, etc.);
- For non-profit purposes, to deduce any content of this blog, please give the relevant webpage address of this site in the form of 'source of original text' or 'reference link' (for the convenience of readers).
See Also:
- Window manager labwc usage notes
- Optimization of Boot Scrolling Font Display
- Deploying Vaultwarden on Raspberry Pi
- Real-time Analysis of Caddy Logs Using goaccess
- Personal Website Monitoring
- Hugo's Complete AVIF Conversion Guide
- Trying to Develop a Small Game Using Godot on Linux
- Arch linux dae Transparent Proxy
- Airflow Takes Over Gallery-DL Download Tasks
- How to Batch Download Images Using gallery-dl