Repository navigation
Conversation
根因:旧数据迁移标记 interactive.scm->v1 / recent-files.scm->v1 的文件名含 '>', 而 Windows 文件名禁止 < > : " | ? *。string-save 写不出该文件,url-exists? 永远为 #f,于是 maybe-import-legacy-scm-interactive-state 在每次启动都判定 「未迁移」,把 $TEXMACS_HOME_PATH/system/interactive.scm 里的旧 recent-buffer 条目重新导入 recent-files.json。用户在启动页或 文件→最近 清空列表后, 一重启旧条目全部回来。macOS/Linux 文件名允许 '>',标记首次即落盘,故不受影响。 修复: - tm-dialogue.scm:标记改名为 interactive.scm.migrated-v1 / recent-files.scm.migrated-v1;保留旧名作为 legacy 标记,新旧任一存在即视为 已迁移(migration-marker-exists?),避免 macOS/Linux 已迁移用户再导入一次。 - shortcut-edit.scm:shortcuts.scm->v1 同类问题,同样处理(否则 Windows 下 用户删除的自定义快捷键每次启动都会从 shortcuts.scm 回灌)。 - tm-dialogue-test.scm:新增 headless 测试——标记文件名不含 Windows 非法字符; 用真实标记文件名在临时目录写入后 url-exists? 为 #t(旧名在 Windows 上必红); 新旧标记任一存在即判定已迁移。 Fixes MoganLab#4466 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Fixes #4466(#4404 子问题)。Windows 下清空最近文件当场生效,重启后旧条目全部回来。
根因
不是清空逻辑或落盘时机的问题,而是启动时的旧数据迁移。
tm-dialogue.scm用标记文件判断interactive.scm是否已迁移到 JSON,文件名是interactive.scm->v1/recent-files.scm->v1。Windows 文件名禁止< > : " | ? *,所以write-migration-marker永远写不出该文件,url-exists?永远#f,maybe-import-legacy-scm-interactive-state每次启动都把interactive.scm里的旧recent-buffer重新灌进recent-files.json。macOS/Linux 允许>,首次即落盘,故只有 Windows 复现。本机 Windows 11 用 PowerShell 验证含>的路径直接报Illegal characters in path。shortcut-edit.scm的shortcuts.scm->v1同类问题(删掉的自定义快捷键每次启动回灌),一并修。改动
tm-dialogue.scm:标记改名*.scm.migrated-v1;旧名保留为 legacy 标记,新增migration-marker-exists?,新旧任一存在即视为已迁移,macOS/Linux 已迁移用户不会再导入一次。write-migration-marker与标记路径改define-public供测试。导入流程未动。shortcut-edit.scm:同样处理。tm-dialogue-test.scm:新增 headless 测试(xmake r tm-dialogue-test)——标记文件名不含 Windows 非法字符;用真实标记名在临时目录写入后url-exists?为#t(旧名在 Windows CI 必红);新旧标记任一存在即判定已迁移。影响
Windows 用户升级后首次启动最后执行一次迁移,标记落盘,之后清空/移除都能跨重启保持。
未做
on-exit写回,崩溃时会丢;是另一类问题,不混入本 PR。gf fmt,烦请以 CI 为准。改动全在 Scheme 层。🤖 Generated with Claude Code