rime / rime/squirrel

mac下聚焦搜索和终端无法输入中文简单解决方案

Open
#584 14 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
6.4k
Forks
554
PR merge metrics
No merged PRs in 30d

Description

最后感谢rime这么好的全平台输入法, 很理解开源且免费项目的不易, 不胜感激!
最佳解决方案

在用户设定目录的squirrel.yaml里, 发现app_options的配置, 好家伙, 原来不是bug, 是默认给关闭掉了, 这...., 好吧, 这么做肯定也是怕有兼容问题吧可能, 不过, 我试着把这些配置关闭掉, 目前完美使用, 神奇!

app_options:
  com.apple.Spotlight:
    ascii_mode: true
  com.alfredapp.Alfred:
    ascii_mode: true
  com.runningwithcrayons.Alfred-2:
    ascii_mode: true
  com.blacktree.Quicksilver:
    ascii_mode: true
  com.apple.Terminal:
    ascii_mode: true
    no_inline: true
  com.googlecode.iterm2:
    ascii_mode: true
    no_inline: true
  org.vim.MacVim:
    ascii_mode: true  # 初始爲西文模式
    no_inline: true   # 不使用行內編輯
    vim_mode: true    # 退出VIM插入模式自動切換輸入法狀態
  com.apple.dt.Xcode:
    ascii_mode: true
  com.barebones.textwrangler:
    ascii_mode: true
  com.macromates.TextMate.preview:
    ascii_mode: true
  com.github.atom:
    ascii_mode: true
  com.microsoft.VSCode:
    ascii_mode: true
  com.sublimetext.2:
    ascii_mode: true
  org.gnu.Aquamacs:
    ascii_mode: true
  org.gnu.Emacs:
    ascii_mode: true
    no_inline: true
  co.zeit.hyper:
    ascii_mode: true
  com.google.Chrome:
    # 規避 https://github.com/rime/squirrel/issues/435
    inline: true
  ru.keepcoder.Telegram:
    # 規避 https://github.com/rime/squirrel/issues/475
    inline: true
以下不是最佳解决方案
  • 从highserria时候起就发现mac下 聚焦搜索和终端界面用鼠须管(14.x)输入时无法输入中文,
    最近用mbp bigsur系统和最新版本的鼠须管15.x+ 发现还是一样的问题.
  • 于是折腾了一番, 最终发现了, 用户设定下default.custom.yaml文件里有'ascii_composer/switch_key: ', 开始事直接将此配置下所有内容注释, 发现shift可以在鼠须管下切换中英模式, 这里的英文模式不是macos的内置英文输入.
    进而推测在聚焦搜索和终端时, 不知道什么原因鼠须管会优先使用自己的英文模式, 又因为默认配置的shift和caps_lock都是noop, 即无法切换成鼠须管的中文输入模式.
  • 按找此思路, 最终将caps_lock依然配置成系统的中英切换, ctrl或shift设置成鼠须管的中英切换, 算是目前通过调整配置能达到的最完美的体验, 诚挚的希望官方能优化下.
  • 附最终配置代码:
      ascii_composer/switch_key:
        Caps_Lock: noop
        # Shift_L: commit_code
        Shift_L: noop
        # Shift_R: noop
        Control_L: commit_code
        # Control_L: noop
        # Control_R: noop
    
  • 效果:
WechatIMG25

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the app_options section in squirrel.yaml and the ascii_composer/switch_key section in default.custom.yaml, focusing on Spotlight and Terminal behavior. Check the issue discussion for the intended default behavior and reproduce Chinese input in those applications. Done means Chinese input works without requiring per-user configuration changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
desktop, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.