Skip to content

fix(config): 修复 shell 解释器切换配置无法持久化的问题#4527

Open
whale-fall-ouo wants to merge 2 commits into
esengine:main-v2from
whale-fall-ouo:fix/shell-prefer-persist
Open

fix(config): 修复 shell 解释器切换配置无法持久化的问题#4527
whale-fall-ouo wants to merge 2 commits into
esengine:main-v2from
whale-fall-ouo:fix/shell-prefer-persist

Conversation

@whale-fall-ouo

Copy link
Copy Markdown
Contributor

问题描述

用户在设置中切换 Shell 解释器(auto/bash/powershell/pwsh)后,当前会话立即生效,但重启后配置丢失,回到 auto。

根因分析

RenderTOMLForScope 渲染 [tools] 段时只输出了 enabledbash_timeout_seconds,没有渲染 [tools.shell] 段。导致 SaveTo 写入磁盘的 TOML 文件中 [tools.shell] 缺失,Tools.Shell.Prefer 永远不会被持久化。

修复方案

render.go[tools] 段后添加 [tools.shell] 的 TOML 渲染,输出 preferpath 字段。

涉及文件

文件 改动
internal/config/render.go 添加 [tools.shell] 段的序列化

Fixes #4447

RenderTOMLForScope 渲染 [tools] 段时没有输出 [tools.shell],
导致用户切换 shell 后配置保存到磁盘时丢失,重启后回到 auto。

添加 [tools.shell] 的 prefer 和 path 字段序列化。

Fixes esengine#4447
@github-actions github-actions Bot added config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Shell解释器无法切换

2 participants