Skip to content

feat(run-config): 解释器字段标出 shell 家族(shellFamily),宿主可列出已安装的同类 shell - #92

Merged
xiaoyumuxi merged 1 commit into
mainfrom
feat/2100-interpreter-shell-family
Nov 18, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
feat/2100-interpreter-shell-family

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

关联 Issue

类型

feat:编辑表单的解释器字段标出它接受哪类 shell(shellFamily),宿主可以在“自动”和自定义路径之外列出已安装的同类 shell

改动

用户希望“解释器路径”像工具链设置那样选择:自动(显示实际生效的程序)、终端已检测到的 shell、自定义路径。哪种运行用哪类 shell 是 Core 的知识,所以由 Core 在表单字段上标出;查找本机安装了哪些 shell、怎么分类,仍是桌面端平台层的事(终端的新建菜单已经在做)。

字段属性 说明
shellFamily(新,可选) 只出现在 kind: executable 的字段上,表示这个程序应是哪类 shell:posix(Shell 脚本)、powershell(PowerShell 脚本)、cmd(批处理)。宿主可以在“自动”和自定义路径之外列出已安装的同类 shell;字段的值仍是命令名或路径,保存、校验、启动都不变。二进制程序(Executable)的 program 字段没有这个属性
  • configuration/process.rs:Kind::shell_family() 给出每种内置运行的 shell 家族。
  • configuration/form.rs:解释器字段加上 shellFamily;新的字段构造方法 shell_family,值为 None 时不写。
  • rust/contracts/rust-core-api.md:字段列表加 shellFamily?,字段属性表加一行说明。
  • 这是桌面端用的 Core 表单 API,不是插件契约,所以不更新插件协议更新记录。

测试

crates/core/src/tests/run_configuration.rs 的 built_in_process_runs_are_created_edited_moved_and_deleted_through_the_editor_form 加断言:Shell、PowerShell、批处理表单的解释器字段分别是 posix、powershell、cmd;二进制程序没有解释器字段,program 字段没有 shellFamily。

本机 macOS 上 cargo fmt --all -- --check、cargo clippy -p lithe-execution -p lithe-core --all-targets -- -D warnings、cargo test -p lithe-execution(30 个)、cargo test -p lithe-core run_config(35 个)全部通过。

脚本类运行配置(shell、PowerShell、批处理)的 interpreter 字段带上
shellFamily:posix、powershell 或 cmd。宿主按这个值筛选自己找到的已安装
shell,作为解释器的可选项,和“自动”、自定义路径并列;保存的值仍是程序名
或路径。程序类配置没有解释器,也就没有这个属性。
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 18, 2026 05:35
@xiaoyumuxi
xiaoyumuxi merged commit 8b91b32 into main Nov 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant