Repository navigation
feat(tui): report hierarchical OSC 7501 program status - #54560
hackrdotsh wants to merge 4 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Works as described. With the simulated model I logged the emitted sequences: idle → working → done/idle per session, plus a root and opencode namespace summary, and a namespace clear on exit. I couldn't check how a real OSC 7501 terminal (Rex) shows them. The new tests and the two updated dialog tests pass, and the TUI package type-checks.
Public API: unchanged. This adds terminal escape output only, with no config, CLI, SDK or plugin surface.
Concerns:
- There's no way to turn this off, and session titles are sent even when users have set
terminal.title: false(see inline). test/program-status.test.tsis large (261 lines) for what it covers. Many assertions depend on exact output positions (output[2],.at(-2),slice(4)) and on full escape strings, so unrelated ordering changes will break them. Please cut it down to a few core cases: state mapping, the root/namespace summary, clearing removed records, and the ID/title limits.
| let disposed = false | ||
| const report = (id: string, state: ProgramState | { state: "clear" }, title?: string) => { | ||
| // Forty-eight Unicode code points fit the 192-byte decoded title cap, even at four bytes each. | ||
| const label = |
There was a problem hiding this comment.
Session titles go to the terminal here (base64) even when a user has set terminal.title: false to stop OpenCode writing titles to the terminal. There's also no way to turn the OSC 7501 reports off. Could this follow the same config (or a sibling terminal.* key) as the window title effect in app.tsx, and at least skip the title when titles are disabled?
55c6bcb to
a8abc09
Compare
|
super important! thanks for working on this |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #54179
Type of change
What does this PR do?
This PR implements OSC 7501 and adds tests for it too. OSC 7501 is a proposed addition to how long running programs can notify the terminal of state changes. This has been implemented as part of superlogical's new multiplexer - rex. (screenshots coming soon)
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
By testing it on Rex on my MacBook Pro
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.
Added by the opencode bot (AI-generated).
Related: #48482, #43904, #36294, #52744