Repository navigation
feat(run): 解释器路径改为下拉——自动、终端检测到的同类 shell、自定义 - #2135
Merged
Merged
Conversation
Shell、PowerShell、批处理表单的“解释器路径”不再是空白路径框,而是和工具链设置一样的下拉: - 第一项“自动(实际生效值)”,括号里是 Core 返回的自动解释器; - 中间是新建终端菜单检测到的、与该运行类型同一类的 shell(Shell 脚本列 POSIX shell, PowerShell 列 pwsh/powershell,批处理列 cmd),WSL 发行版不列; - 最后是“自定义…”,展开“自定义解释器”输入框,可填命令名或路径,右侧按钮选择文件。 shell 类别由 Core 在解释器字段上给出(shellFamily,Core #92),宿主只做检测和呈现。 每个表单首次绘制时重新检测一次 shell,所以新装的 shell 也能列出。 Refs #2100
…-picker # Conflicts: # .agents/notes/implemented/architecture/2026-11-18-builtin-process-runs-and-run-file-formats.md # docs/assets/builtin-process-runs/README.md # docs/assets/builtin-process-runs/builtin-run-batch-dark.png # docs/assets/builtin-process-runs/builtin-run-batch-light.png # docs/assets/builtin-process-runs/builtin-run-dialog-empty-dark.png # docs/assets/builtin-process-runs/builtin-run-dialog-empty-light.png # docs/assets/builtin-process-runs/builtin-run-executable-dark.png # docs/assets/builtin-process-runs/builtin-run-executable-light.png # docs/assets/builtin-process-runs/builtin-run-new-menu-dark.png # docs/assets/builtin-process-runs/builtin-run-new-menu-light.png # docs/assets/builtin-process-runs/builtin-run-powershell-dark.png # docs/assets/builtin-process-runs/builtin-run-powershell-light.png # docs/assets/builtin-process-runs/builtin-run-run-menu-dark.png # docs/assets/builtin-process-runs/builtin-run-run-output-dark.png # docs/assets/builtin-process-runs/builtin-run-shell-file-dark.png # docs/assets/builtin-process-runs/builtin-run-shell-file-light.png # docs/assets/builtin-process-runs/builtin-run-shell-text-dark.png # docs/assets/builtin-process-runs/builtin-run-shell-text-light.png # docs/assets/builtin-process-runs/builtin-run-title-unavailable-dark.png # scripts/desktop/build-desktop-core.sh # shared/platform-feature-matrix/features/builtin-process-runs.json
xiaoyumuxi
marked this pull request as ready for review
November 18, 2026 05:45
2 tasks done
15 of 18 tasks
12 of 15 tasks
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
以前,Shell 脚本、PowerShell 脚本和批处理脚本表单的“解释器路径”只是一个空白路径框,用户得自己记住并填写 bash、pwsh 的完整路径。终端的“新建终端”菜单已经能检测本机装了哪些 shell,运行配置却用不上这份结果。
现在这个字段改成下拉,参照工具链设置的写法:默认选“自动(实际生效值)”,也可以直接选终端检测到的同类 shell,或者选“自定义…”填写任意命令名或路径。
改动 / Changes
Core(Lithe-IDEA/Lithe-core-rust#92,已合入 Core main 8b91b32)
executable类型)新增属性shellFamily:Shell 脚本是posix,PowerShell 是powershell,批处理是cmd;可执行程序没有这个属性。宿主按它列出同一类 shell,不用按运行类型自己猜。契约文档rust/contracts/rust-core-api.md已补字段说明,测试断言了每种运行类型的取值。桌面端
desktop/internal/core/run_process.go:RunEditorField新增ShellFamily。desktop/internal/workbench/runconfig_shell_view.go:带shellFamily的解释器字段画成一个下拉,选项依次为:#!指定的程序或/bin/sh);没有自动值时只显示“自动”。shellkind.FromProgram判断;WSL 发行版(wsl:开头)没有可以直接启动的程序路径,不列出。ui.C.After:表单第一次出现的那一帧可能没有点击,这样的帧会丢弃After回调(与 fix(tree): 鼠标停留打开“打开于”时也查询应用,不再一直显示“正在查找应用…” #2133 同一个原因),Agent Note 里已写明。runconfig_form.go:表单状态新增每个字段的下拉状态(shellPicks)和“本表单已检测过 shell”标记(shellsAsked)。runconfig_form_view.go:executable类型的字段先尝试画下拉;Core 没给shellFamily,或给了宿主不认识的类别时,仍画原来的路径框。文案(
shared/i18n/)desktop.runConfig.interpreterAutomatic(自动)、interpreterShell({name}({path}))、interpreterCustom(自定义…)、interpreterCustomField(自定义解释器,即输入框的无障碍名称,和下拉的名称不同)。desktop.runConfig.interpreterHelp,说明三种选法。shared.generated.go。Core 固定版本
scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION指向 Core main 8b91b32(ci: add rolling macOS preview release workflow #92 的合入 commit,树和原分支 e3a974e 一致),在 main 已固定的 5204e81(Merge Preview 0.3.0 into main #91)之上。文档、功能矩阵、Agent Note
2026-11-18-builtin-process-runs-and-run-file-formats.md新增“解释器路径从终端检测到的 shell 里选”一节,正反做法都写了:ui.C.After推迟 shell 检测。Windows 上 bash 的说明也改成了“从列表选 Git Bash,或在自定义里填完整路径”。
builtin-process-runs.json:docs/assets/builtin-process-runs/README.md:测试
runconfig_shell_test.go(新):TestRunConfigShellChoicesListTheFamilyAndCustom:只列同类 shell(不列 pwsh、fish、WSL)、选项顺序和文字、字段已有值单独列出、没有自动值的情况。TestRunConfigInterpreterListsTheTerminalShells:在真实对话框里依次操作:选 bash,确认字段写入;选“自定义…”,确认输入框出现、可输入;改回 bash,确认输入框收起;点“应用”,确认local.yaml存了/bin/bash;再选“自动”,确认字段清空。runconfig_process_visual_test.go:使用固定的 shell 列表(zsh、bash、pwsh),截图不受本机安装的 shell 影响;新增interpreter-list和interpreter-custom两个场景。正式运行前把解释器改回自动,避免用不存在的路径去跑。不在本 PR 范围内 / Out of scope
split_arguments的反斜杠问题:另行处理。合入最新 main
#2134 已合入 main(08ccf3a)。本分支用 merge 合入了最新 main,冲突这样处理:
scripts/desktop/build-desktop-core.sh:固定版本取 8b91b32(包含 feat(run): 运行/调试配置对话框对齐 IDEA——空白页、复制任意配置、文件夹、排序和 ⌫/Delete 删除 #2134 需要的 5204e81),两段说明都保留。builtin-process-runs.json:以 main 的文字为准,再补上解释器下拉的说明、验证步骤和runconfig_shell_view.go、runconfig_shell_test.go两条证据。docs/assets/builtin-process-runs/的截图:合入后重新跑截图测试,全部重新生成。文件夹、复制几张截图里的 Shell 脚本编辑器现在也显示解释器下拉。类型专属:feat
多平台对齐
localshell.InstalledShells)和类别判断(shellkind)都在 Viva 共享代码里,macOS 和 Windows 同时具备;Windows 上会列出 PowerShell、pwsh、cmd 和 Git Bash 等检测到的 shell。Windows 实机验证未做,矩阵里保持pending。platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/builtin-process-runs.json:两个平台都加了证据路径和验证动作;没有运行的验证保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(通过)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
UI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR=… scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench -run '^TestVisualBuiltInProcessRuns$' -count=1docs/assets/builtin-process-runs/,嵌在下面。合入 main 后整组截图重新生成。统一日志系统 / Structured logging
app.action.performed(action 为run.configuration.form.interpreter.choose,surface 为 menu);保存和刷新沿用表单原有的事件界面文案 / i18n
shared/i18n/补齐中英文,生成文件已重新生成并提交;Viva 代码通过i18n.Shared和i18n.SharedFormat读取node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check都通过逻辑归属 / Logic placement
shellFamily),自动值也由 Core 计算;宿主只负责平台相关的 shell 检测、按类别筛选和显示shellkind.FromProgram;终端也要用到它,而且它判断的是本机安装的程序,所以留在平台层性能与内存 / Performance and memory
设置 / Settings
插件契约 / Plugin contract
N/A:
shellFamily是 Core 内部运行配置编辑表单(runConfig.editorForm)的字段属性,不属于插件契约(shared/plugins/contract/v1/),也不是宿主方法;已写进rust/contracts/rust-core-api.md。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh通过无用代码与重构 / Dead code and refactoring
shellFamily的解释器字段不再走旧的路径框,但这段代码可执行程序路径和不认识的类别还在用,不算无用代码验证 / Verification
cargo fmt --check、cargo clippy、cargo test -p lithe-execution(30)、lithe-core的 run_config 测试(35)scripts/desktop/desktop-go.sh vet ./...scripts/desktop/desktop-go.sh test ./internal/workbench/ ./internal/core/ ./internal/i18n/ -count=1TestRunConfigShellChoicesListTheFamilyAndCustom、TestRunConfigInterpreterListsTheTerminalShellsTestVisualBuiltInProcessRuns(vivahead lithevisual)gofmt -lnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --checkverify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/agent-notes/verify-agent-notes.sh./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main./scripts/desktop/verify/verify-runtime-bundle-immutability.sh未能执行的检查和原因:
提交前确认 / Final checks
main(2fa0d24)创建,已 merge 最新main(08ccf3a),目标分支是main