Repository navigation
fix(term): keep the records a program reports through OSC 7501 at a prompt - #17
Merged
Raiden-MeixElysia merged 1 commit intoOct 24, 2026
Conversation
…rompt A program may wrap each message it renders in OSC 133 marks of its own, as omp 18.12.5 does: every mark A read as a new prompt, which dropped the working record the program itself had reported, so a row's running mark came and went while an agent worked (ELY-Open-Source#10). A prompt now ends the records of a session where no program reports through OSC 7501; one that does ends its records itself, as omp does with done, and herdr's waiting agents keep their places.
Contributor
Author
|
这个处理的是 omp 工作时和完成时所对应的 ELYTerminal 的相关图标状态混乱了的问题。 |
Contributor
Author
|
@Raiden-MeixElysia 可以审计了,我用了一天发现确实修复了问题。现在当 omp 的 working、finish 和 idle 都正常对应上了。 |
Contributor
|
OK |
Raiden-MeixElysia
added a commit
that referenced
this pull request
Oct 24, 2026
…e records, as OSC 7501 asks: the records count running commands as OSC 133 C and D nest them, so omp's marks inside the shell's C keep its work, in place of PR #17's gate
Contributor
|
谢谢你的排查和这个 PR,已合并进 main(4b4e1b0)。 你找到的根因是对的:omp 给每条消息都打 OSC 133 A,每个 A 都把它自己的 working 记录清掉了。合并后我把门控换了一种做法,因为规范要求真正的 shell 提示符必须清掉 working 和 blocked:如果有程序上报过 7501 就一律不清,一个崩溃的程序会一直显示 working。 现在的做法(89b4873):
审查用真实的 zsh、fish、PowerShell 跑了 omp 式的消息流、Ctrl+C 打断、嵌套 shell、后台任务等场景,都对。这会进下一个版本。再次感谢! |
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.

跟随 #11(已合并)的同一根因:omp 逐消息的 OSC 133 标记。#10 评论区报告的现象——omp working 时会话的运行时动效时有时无、ready 同理。
根因
omp 每渲染一条消息输出一组
133;A B C D;0。ELYTerminal 对每个 A 视为新提示符,Records::prompt()(src/term/status.rs)执行retain(Done | Error)——清掉 Working/Blocked/Idle 记录。state=working:app=omp,第一条消息渲染时该记录即被清掉,动效消失;直到下一次 7501 上报(回合/工具调用边界)才复活 → 时有时无。ready(idle 记录)同理被消息渲染的 A 清掉。blocked(等待授权)记录也会被同一面板里敲命令时的 A 误清。pty 捕获的完整序列证据见 PR #11 与 issue #10 评论。
修复
用现成的
Records.reported标志(自上次全复位以来有程序通过 OSC 7501 上报过)门控prompt():说 7501 的程序自管生命周期(omp 以state=done结束回合),A 不再清它的记录;真实 shell 集成只发 133 从不发 7501,行为不变。herdr 的 waiting 记录也因此不再被误清。取舍
程序上报 working 后异常退出(无终态、无 clear)会留下滞留记录。omp 每回合必报 done,herdr 自管 seen;
prompt()跳过时留有 debug 日志,OSC c 全复位与下一次 7501 上报均可清除。验证
e477637后cargo test --lib:273 通过;3 个失败均为本机环境问题(fish 4.9.1 与上游 CI 版本差异、缺 Xvfb ×2),干净 main 上同样失败。a_new_prompt_leaves_done_and_error_unless_a_program_reports_itself:7501 上报过的会话记录在提示符处保留;shell 会话(含 OSC 9;4 进度记录)照旧在提示符处清理。