Repository navigation
Add ghostel-set-program-status for bridged terminals - #810
Merged
Merged
Conversation
A bridged terminal whose far end keeps the program status records (OSC 7501) needs to put them into the buffer after restoring a snapshot, which carries none. ghostel-set-program-status replaces the records as a whole: ghostel-program-status-functions runs only for records added, changed or removed, and a removed parent no longer takes a kept child with it. Unknown states count as idle; unknown kinds and progress outside 0-100 are dropped, through the same check the OSC path uses. With QUIET none of the changes notifies. The new ghostel-status-inhibit-notify makes ghostel-status-attention-p nil while it is bound, so ghostel-status-notify and notifiers built on it stay silent while ghostel-status-notify-states keeps its value for ghostel-status-buffers and friends. A non-empty set suppresses OSC 9/777 and OSC 9;4 as a real report does, an empty one re-enables them, and done/error records are acknowledged at once under ghostel-status-auto-acknowledge seen.
This branch was previously deployed
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.
A bridged terminal fed from a libghostty snapshot plus the raw PTY stream gets no program status records (OSC 7501) from the snapshot. When the far end keeps them, the client needs a public way to put them into the buffer without notifying for day-old catch-up state.
API
(ghostel-set-program-status RECORDS &optional QUIET), called in the terminal buffer.(ID . PLIST), most recently updated first, ID a string (""for the root), PLIST with:state,:kind(symbols),:progress,:app,:title,:msg.idle; unknown kind and progress outside 0-100 are dropped.ghostel--osc-program-statusbuilds its records through the same check (ghostel-status--valid-record).ghostel-program-status-functionsruns once per record added, changed or removed, after the whole set is in place; equal records run nothing.ghostel-status-inhibit-notify, which makesghostel-status-attention-pnil, soghostel-status-notifyand notifiers built on it stay silent.ghostel-status-notify-stateskeeps its value, soghostel-status-buffers, the mode line and the indicator report the states normally, also inside the hooks.ghostel-status-auto-acknowledgeseen, done/error records set into the buffer being looked at are acknowledged at once.Tests
New elisp tests in
test/ghostel-status-test.el: full replace (added, changed, unchanged with no hook, removed), parent removed while child kept, validation, QUIET vs. non-QUIET notification withghostel-status-bufferschecked inside the hook, OSC 9 / 9;4 suppression, root title, andseenacknowledgement.make -j8 allpasses.