im-select.nvim
im-select.nvim copied to clipboard
[Bug] macOS中Rime和落格输入法切换失败
问题描述:在macOS 14.4.1中,只有苹果内置的双拼输入法在切换回insert模式时可以正确唤出中文输入,而Rime和落格输入法则不行。并且查看输入法的配置中,没有正常显示。
而在terminal中通过命令行直接执行
im-select com.apple.keylayout.ABC
im-select com.logcg.inputmethod.LogInputMac3.LogInputMac3IME
是可以正常切换到中文输入法并输出中文,配置中也是正常的。
配置文件:
return {
"keaising/im-select.nvim",
config = function()
require("im_select").setup({
-- IM will be set to `default_im_select` in `normal` mode
-- For Windows/WSL, default: "1033", aka: English US Keyboard
-- For macOS, default: "com.apple.keylayout.ABC", aka: US
-- For Linux, default:
-- "keyboard-us" for Fcitx5
-- "1" for Fcitx
-- "xkb:us::eng" for ibus
-- You can use `im-select` or `fcitx5-remote -n` to get the IM's name
default_im_select = "com.apple.keylayout.ABC",
-- Can be binary's name or binary's full path,
-- e.g. 'im-select' or '/usr/local/bin/im-select'
-- For Windows/WSL, default: "im-select.exe"
-- For macOS, default: "im-select"
-- For Linux, default: "fcitx5-remote" or "fcitx-remote" or "ibus"
default_command = "im-select",
-- Restore the default input method state when the following events are triggered
set_default_events = { "VimEnter", "FocusGained", "InsertLeave", "CmdlineLeave" },
-- Restore the previous used input method state when the following events
-- are triggered, if you don't want to restore previous used im in Insert mode,
-- e.g. deprecated `disable_auto_restore = 1`, just let it empty
-- as `set_previous_events = {}`
set_previous_events = { "InsertEnter" },
-- Show notification about how to install executable binary when binary missed
keep_quiet_on_no_binary = false,
-- Async run `default_command` to switch IM or not
async_switch_im = true,
})
end,
}
macOS 自带的输入法会有类似的问题吗?
我只有 Rime 和系统自带的英语输入法,测试了一下是正常的
macOS 自带的输入法会有类似的问题吗?
我只有 Rime 和系统自带的英语输入法,测试了一下是正常的
系统自带的输入法是正常的,但是Rime我也测试了,也会出现这种情况。另外我又通过Keyboard Maestro软件设置了快捷键来切换输入法,也出现了这种情况。因此我初步怀疑这不是im-select的问题,而是macOS系统问题,我的是14.4.1,如果可以您可以先试一下对齐下系统。
就哪怕是通过Keyboard Maestro设置 Set Keyboard Layout to "Squirrel - Simplified"来执行切换,也会出现这种情况。这种感觉就像是输入法切换成功了,但是配置没加载成功。
我确实也是 14.4.1,但是没有复现,可能是 bugOS 的什么奇怪 "feature"
在升级到14.4.1 (23E224)后,也出现了同样的问题,切换到百度输入法后,无法输入中文,应该是最近的os版本引入的bug
你们的 Neovim 是什么版本?可以把最近的稳定版和 nightly 都试试吗? @QianChenglong @RayKr
你们的 Neovim 是什么版本?可以把最近的稳定版和 nightly 都试试吗? @QianChenglong @RayKr
❯ nvim --version NVIM v0.9.5 Build type: Release LuaJIT 2.1.1713517273
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"
Run :checkhealth for more info
最近升级macos才出现的,用im-select命令执行一样会出问题,和插件无关
我的也是NVIM v0.9.5,14.4.1 (23E224),相同问题。
macOS升级到14.5的Public Beta版本也没有修复这个问题。
好蛋疼,我也出现这个问题了。。。
是的,不是插件本身的瓿,我用im_select测试也出现这个问题的。
我也遇到了,搜狗拼音输入法用中文,切回来之后变英文(状态显示还是中文,但实际输入是英文),但不是必现,不过概率比较大,超过50%。用系统自带的拼音输入法就没问题。
Neovim 版本:
$ nvim --version
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1724512491
Run "nvim -V1 -v" for more info
mac信息:
我现在都升级到macOS 15.0 Beta (24A5331b)了,这个问题依旧存在,大概率凉了
全新发布的 15.0 怎么样?是不是还存在?
我最近想到的一个办法是用 macOS 的 Accessible API 模拟用户直接去切换右上角的输入法,不用现在 im-select 了,但是我不会写 Swift。。。而且不太有时间去学,感觉要拖延了。。。