Pengwin icon indicating copy to clipboard operation
Pengwin copied to clipboard

Fcitx input method not working

Open hanubeki opened this issue 5 years ago • 10 comments

Describe the bug I have installed Pengwin today, with fcitx and mozc input method. When I installed fcitx, input method list is displayed in configuration, then I could add "Mozc - Japanese". But after I restarted WSL, fcitx mozc is not working, fcitx configuration doesn't even show input method list.

Also, following warning is displayed after run fcitx-autostart & every few seconds

(WARN-183 dbusstuff.c:197) Connection Error (Failed to connect to socket "localhost:64033" 接続を拒否されました)

(Japanese part of the message means "Connection refused")

To Reproduce Steps to reproduce the behavior:

  1. Install Pengwin
  2. Run pengwin-setup for first time, it prompts to update itself
  3. Run pengwin-setup again
  • I have installed following options.
    • GUI (FCITX, GUILIB, STARTMENU, WINTHEME)
      • When installing fctix, added "Mozc - Japanese" and bind "Zenkakuhankaku" (Full-Half) to switch input method.
    • SETTINGS (EXPLORER, LANGUAGE)
      • Added ja_JP.UTF-8 and set as default
  1. sudo apt update, sudo apt upgrade, sudo apt autoremove
  2. exit
  3. wsl -t WLinux in PowerShell Core 6
  4. Start Pengwin again
  5. sudo apt install libreoffice libreoffice-gtk2 libreoffice-l10n-ja libreoffice-help-ja firefox-esr-l10n-ja
  6. Start LibreOffice or Firefox (ESR)
  7. I tried to press "Zenkakuhankaku" (Full-Half) or Ctrl+Space to change input method to Mozc, but I can't input Japanese characters.

I tried sudo service dbus restart and dbus-launch --exit-with-x11 then fcitx-autostart & but I still can't input Japanese characters.

Expected behavior Input method should be switched and can input Japanese characters.

Screenshots If applicable, add screenshots to help explain your problem.

image

Additional context Add any other context about the problem here.

Basic Troubleshooting Checklist

  • [x] I have searched Google for the error message.
  • [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
  • [x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues.
  • [x] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues.
  • [x] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset.
  • [x] I have disabled and re-enabled WSL in Windows Features.
  • [x] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted?

Insert here:

Pengwin Version

Find: Settings->Apps->Apps & features->Pengwin->Advanced Options->Version.

Insert here: 1.2.5.0

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here:

OS 名:                  Microsoft Windows 10 Home
OS バージョン:          10.0.18362 N/A ビルド 18362
OS 製造元:              Microsoft Corporation
OS 構成:                スタンドアロン ワークステーション
OS ビルドの種類:        Multiprocessor Free
BIOS バージョン:        American Megatrends Inc. 4.6.5, 2012/03/05

For help on retrieving: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#check-your-build-number

hanubeki avatar Jul 19 '19 13:07 hanubeki

I think this is a dbus thing. I ran dbus-launch --exit-with-x11 and copy DBUS_SESSION_BUS_ADDRESS line then export copied line and run fcitx-autostart & and I can now input Japanese characters.

Edit: I found an easier workaround: dbus-launch fcitx-autostart

hanubeki avatar Jul 20 '19 09:07 hanubeki

https://github.com/WhitewaterFoundry/pengwin-setup/blob/e28d1833d1745d1a45b45bca4fd02805f39d298d/pengwin-setup.d/guilib.sh#L30

eval "$(dbus-launch --auto-syntax)" writes a result of dbus-launch --auto-syntax to /etc/profile.d/dbus.sh and not acutually run dbus-launch --auto-syntax in dbus.sh.

hanubeki avatar Jul 20 '19 09:07 hanubeki

https://github.com/WhitewaterFoundry/pengwin-setup/blob/c54041dccdcb39043105e49209dabe17b89beabc/pengwin-setup.d/fcitx.sh#L82 Also, fcitx-autostart &>/dev/null is wrote to /etc/profile.d/fcitx, not /etc/profile.d/fcitx.sh.

hanubeki avatar Jul 20 '19 09:07 hanubeki

Hello,

Thank you for reporting and also find the solution. We will work soon in this issue and incorporate the patches for the next release.

Regards

crramirez avatar Jul 20 '19 11:07 crramirez

Hi, the content above was posted in July. Is there a fix yet? I had just installed pengwin & fcitx and experienced the same issue. What is the best way I can get it fcitx working every time I started up pengwin without manually entered commands?

eliranwong avatar Nov 24 '19 23:11 eliranwong

temporarily, I put the following line in ~/.profile

dbus-launch /usr/bin/fcitx-autostart > /dev/null 2>&1

I would like to know if there is a better fix?

eliranwong avatar Nov 24 '19 23:11 eliranwong

Hello @eliranwong

We will check ans get back with a solution, probably we need to add something to /etc/profile. For any reason we miss to resolve this for 1.3 release.

Regards

crramirez avatar Nov 25 '19 06:11 crramirez

Hello @crramirez

Thanks for reply.

I would like to share one more observation. I tried to put "dbus-launch fcitx-autostart" in some other locations. Though fcitx can run, word candidate/selection panel failed to be displayed.

For example, I tried using zsh as default shell and put a line "dbus-launch /usr/bin/fcitx-autostart > /dev/null 2>&1" in ~/.zprofile. As I type Chinese, fcitx is running but I do not see word selection panel, so I cannot select the right Chinese words to be entered.

any ideas?

Regards

eliranwong avatar Nov 25 '19 13:11 eliranwong

After testing fcitx with different gui applications, I found that fcitx is very broken in some applications running under pengwin. To solve the issue, I installed ibus. It seems ibus works perfectly under pengwin, at least for typing Chinese. iBus comes to the rescue where fcitx is broken. So I now switch to ibus for main input method as my solution.

eliranwong avatar Nov 30 '19 08:11 eliranwong

Excellent thank you for sharing it. We will put it in our road map

crramirez avatar Nov 30 '19 10:11 crramirez