Repository navigation
feat(macos): 终端环境补充 TERM_PROGRAM_VERSION - #1416
Merged
Merged
Conversation
Lithe Review结论: Findings
Scope Check
Suggestions
Summary已知版本路径较为直接,并与 Windows 端通过打包版本提供该变量的做法一致。建议补齐未知版本与继承环境组合下的行为。本问题为非阻塞建议。 Verification
|
## 背景 - Windows 端已随 `TERM_PROGRAM` 一并导出 `TERM_PROGRAM_VERSION`(`windows/tauri/crates/terminal/src/connection.rs:268`),macOS 端缺失,同一产品两平台环境不一致。 - 工具按版本门控终端能力是既有惯例(如 oh-my-pi 以该变量区分 tmux 版本行为);Lithe 引入新的外部可观察能力(如背景变更推送)后,也需要一个版本位供 TUI 安全启用。 ## 改动 - `TerminalTransport` 协议新增 `termProgramVersion: String?`(无法取得时为 nil),extension 默认 nil - `TerminalSession` 以可选值直赋导出 `TERM_PROGRAM_VERSION`,版本未知时同时清除从外层终端继承的同名值 - macOS 取应用打包版本(`CFBundleShortVersionString`),与 Windows 报告的打包版本一致 - `TerminalModuleTests` 新增 3 个用例(导出、无法取得不写入、清除继承值);更新 `terminal-shell.json` 能力矩阵 ## 验证 - `TerminalModuleTests` 全绿(含 3 个新增) - 平台能力矩阵门禁通过
icefery
force-pushed
the
feat/macos-terminal-program-version
branch
from
October 22, 2026 04:14
ac7da26 to
7f72a52
Compare
xiaoyumuxi
reviewed
Oct 22, 2026
xiaoyumuxi
left a comment
Collaborator
There was a problem hiding this comment.
跨 PR 审查(head 7f72a526)
结论:独立变更较集中,未发现明确新逻辑缺陷;建议同步最新 preview 后完成合并验证。 当前 GitHub mergeable=false,各项 CI 结果显示通过。
实现从 bundle 的 CFBundleShortVersionString 报告 termProgramVersion,在 TerminalSession 中写入 TERM_PROGRAM_VERSION;未知时使用 environment["TERM_PROGRAM_VERSION"] = nil 的字典语义删除从父进程继承的旧值,之前对此边界的审查不应继续标为未修复。
建议合并后用真实打包 app + 开发运行环境分别检查:TERM_PROGRAM=Lithe 时版本有值且与包一致;无版本时不会误沿用 Terminal.app/iTerm 外层的版本;终端 shell 仍可收到调用方显式环境覆盖。若与 #1415、已合并 #1414 共用终端接线,需复查组合环境,不要通过复制一份新的 transport 实现来合并冲突。
本轮未独立执行 macOS 终端。
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.
背景
TERM_PROGRAM一并导出TERM_PROGRAM_VERSION(windows/tauri/crates/terminal/src/connection.rs:268),macOS 端缺失,同一产品两平台环境不一致。改动
TerminalTransport协议新增termProgramVersion: String?(无法取得时为 nil),extension 默认 nilTerminalSession构建终端环境时导出TERM_PROGRAM_VERSIONCFBundleShortVersionString),与 Windows 报告的打包版本一致TerminalModuleTests新增 2 个用例(导出、无法取得不写入);更新terminal-shell.json能力矩阵验证
TerminalModuleTests11 用例通过(含 2 个新增);平台能力矩阵门禁通过echo $TERM_PROGRAM_VERSION输出应用打包版本,与「关于」一致