From aa18b18853f369dfb47f7fd632827035641b9b0b Mon Sep 17 00:00:00 2001 From: douboer Date: Tue, 4 Nov 2025 20:25:12 +0800 Subject: [PATCH] update at 2025-11-04 20:25:12 --- CHANGELOG.md | 13 +++++++++++++ CHANGELOG_en.md | 13 +++++++++++++ README.md | 2 ++ README_en.md | 2 ++ RELEASE.md | 13 +++++++++---- deploy.sh | 6 +++--- fcitx-osx.vim => vim-im-switch.vim | 12 ++++++++---- 7 files changed, 50 insertions(+), 11 deletions(-) rename fcitx-osx.vim => vim-im-switch.vim (83%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a41e24b..298be5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,19 @@ --- +## [2.0.2] - 2025-11-04 + +### 修复 + +- 终端兼容性:修复在 macOS 终端(vi/vim)中按 ESC 时,子进程输出导致标题栏短暂闪烁的问题(使用 nohup/background 方式彻底静默化命令执行) +- 兼容性:移除 `job_start(..., {'detach': v:true})` 不兼容选项,改以更通用的后台执行方式 + +### 文档 + +- 补充 RELEASE/README 中关于终端下行为的说明 + +--- + ## [1.0.8] - 2025-01-04 这是一个重大更新版本,引入了输入法状态记忆功能,并修复了多个关键问题。 diff --git a/CHANGELOG_en.md b/CHANGELOG_en.md index 4296713..b3d3730 100644 --- a/CHANGELOG_en.md +++ b/CHANGELOG_en.md @@ -55,6 +55,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [2.0.2] - 2025-11-04 + +### Fixed + +- Terminal compatibility: Fixed brief terminal/tab title flash when invoking `fcitx-remote` from terminal Vim by launching commands fully detached (nohup/background) and redirecting output +- Compatibility: Removed unsupported `job_start(..., {'detach': v:true})` usage to work with more Vim builds + +### Documentation + +- Minor docs update: note terminal behavior fix in README and RELEASE + +--- + ## [1.0.8] - 2025-01-04 This is a major update that introduces input method state memory and fixes several critical issues. diff --git a/README.md b/README.md index dd5fe0a..04132b4 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,8 @@ sudo pacman -S fcitx ./deploy.sh ``` +Note: v2.0.2 fixes a terminal-specific title/flash issue when using terminal Vim (see CHANGELOG for details). + ## 使用方法 ### 基本使用场景 diff --git a/README_en.md b/README_en.md index fd39725..fdcf4dc 100644 --- a/README_en.md +++ b/README_en.md @@ -98,6 +98,8 @@ Deploy both plugins with a single command: ./deploy.sh ``` +Note: v2.0.2 fixes a terminal-specific title/flash issue when using terminal Vim (see CHANGELOG for details). + ## Usage ### Basic Usage Scenarios diff --git a/RELEASE.md b/RELEASE.md index 773fb0d..a0a83e5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,11 +1,19 @@ # 版本发布说明 RELEASE NOTE -## v2.0.0 +## v2.0.1 **发布日期**: 2025-11-04 --- +### v2.0.1 - Patch Notes + +- 验证并修复:终端(macOS Terminal / iTerm2)下 `vi` 按 `ESC` 时顶部短暂显示 `fcitx-remote` 的问题(使用 `nohup` + 后台执行并重定向,避免任何 stderr/stdout 导致的 UI 更新) +- 修复:删除对 `job_start` 不兼容的 `{'detach': v:true}` 选项以兼容更多 Vim 构建 +- 文档微调:更新 README/CHANGELOG/RELEASE,记录上述兼容性修复 + +--- + ### 版本概述 版本 2.0.0 是一个重要的里程碑版本,为 Vim 输入法自动切换插件带来了重大改进。此版本包含: @@ -206,6 +214,3 @@ npm run build ### 许可证 MIT License - 详见 [LICENSE.txt](./LICENSE.txt) - ---- - diff --git a/deploy.sh b/deploy.sh index 3fef94e..ac1cb55 100755 --- a/deploy.sh +++ b/deploy.sh @@ -63,9 +63,9 @@ echo -e " • styles.css" # 复制 Vim 插件 echo -e "${YELLOW}📋 复制 Vim 插件...${NC}" mkdir -p ~/.vim/plugin -cp -f fcitx-osx.vim ~/.vim/plugin/ +cp -f vim-im-switch.vim ~/.vim/plugin/ echo -e "${GREEN}✅ Vim 插件复制完成:${NC}" -echo -e " • fcitx-osx.vim → ~/.vim/plugin/" +echo -e " • vim-im-switch.vim → ~/.vim/plugin/" # 验证文件 echo -e "${YELLOW}🔍 验证复制的文件...${NC}" @@ -75,4 +75,4 @@ echo -e "${GREEN}🎉 部署完成!${NC}" echo -e "${BLUE}📍 Obsidian 插件已部署到: $TARGET_DIR${NC}" echo -e "${BLUE}📍 Vim 插件已部署到: ~/.vim/plugin/${NC}" echo -e "${YELLOW}💡 请重启 Obsidian 或重新加载插件以使更改生效${NC}" -echo -e "${YELLOW}💡 Vim 插件将在下次启动 Vim 时自动加载${NC}" \ No newline at end of file +echo -e "${YELLOW}💡 Vim 插件将在下次启动 Vim 时自动加载${NC}" diff --git a/fcitx-osx.vim b/vim-im-switch.vim similarity index 83% rename from fcitx-osx.vim rename to vim-im-switch.vim index 3eb65cc..34acc40 100644 --- a/fcitx-osx.vim +++ b/vim-im-switch.vim @@ -51,9 +51,13 @@ function! Fcitx2en() " 切换到英文输入法(使用后台任务并重定向所有输出) if has('job') - call job_start(['sh', '-c', 'fcitx-remote -s ' . shellescape(g:fcitx_english_im) . ' >/dev/null 2>&1']) + " Use nohup in a shell backgrounded process. Some Vim builds don't accept + " the 'detach' option; calling via sh -lc with nohup/& keeps process + " disassociated while avoiding unsupported job_start options. + call job_start(['sh', '-lc', 'nohup fcitx-remote -s ' . shellescape(g:fcitx_english_im) . ' >/dev/null 2>&1 &']) else - call system("fcitx-remote -s " . shellescape(g:fcitx_english_im) . " >/dev/null 2>&1 &") + " Fallback: nohup in background + call system('nohup fcitx-remote -s ' . shellescape(g:fcitx_english_im) . ' >/dev/null 2>&1 &') endif endfunction @@ -71,9 +75,9 @@ function! Fcitx2zh() " 上次是中文输入法,恢复到那个输入法(使用后台任务并重定向所有输出) if has('job') - call job_start(['sh', '-c', 'fcitx-remote -s ' . shellescape(g:fcitx_last_insert_im_name) . ' >/dev/null 2>&1']) + call job_start(['sh', '-lc', 'nohup fcitx-remote -s ' . shellescape(g:fcitx_last_insert_im_name) . ' >/dev/null 2>&1 &']) else - call system("fcitx-remote -s " . shellescape(g:fcitx_last_insert_im_name) . " >/dev/null 2>&1 &") + call system('nohup fcitx-remote -s ' . shellescape(g:fcitx_last_insert_im_name) . ' >/dev/null 2>&1 &') endif endfunction " ---------------------------------------------------------------------