fix(config): 修复 shell 解释器切换配置无法持久化的问题#4527
Open
whale-fall-ouo wants to merge 2 commits into
Open
Conversation
RenderTOMLForScope 渲染 [tools] 段时没有输出 [tools.shell], 导致用户切换 shell 后配置保存到磁盘时丢失,重启后回到 auto。 添加 [tools.shell] 的 prefer 和 path 字段序列化。 Fixes esengine#4447
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.
问题描述
用户在设置中切换 Shell 解释器(auto/bash/powershell/pwsh)后,当前会话立即生效,但重启后配置丢失,回到 auto。
根因分析
RenderTOMLForScope渲染[tools]段时只输出了enabled和bash_timeout_seconds,没有渲染[tools.shell]段。导致SaveTo写入磁盘的 TOML 文件中[tools.shell]缺失,Tools.Shell.Prefer永远不会被持久化。修复方案
在
render.go的[tools]段后添加[tools.shell]的 TOML 渲染,输出prefer和path字段。涉及文件
internal/config/render.go[tools.shell]段的序列化Fixes #4447