Repository navigation
0.5.0
ProgramStatus is now OperatingSystemCommands, imported as OSC. One package now holds several terminal OSC protocols. This release also adds the first new one, Program Resume (OSC 7577).
⚠️ Breaking Changes
-
New package and module name: the package and its library product are now
OperatingSystemCommands, and the module is imported asOSC. The Program Status API is unchanged. To upgrade, update your dependency and your imports:.package(url: "https://github.com/velocityzen/OperatingSystemCommands", from: "0.5.0"), // target dependency: .product(name: "OperatingSystemCommands", package: "OperatingSystemCommands"),
import OSC // was: import ProgramStatus
✨ New Features
- Program Resume (OSC 7577, revision 0.5): tell the terminal how to start your program again when it restores a session. Use
ProgramResumeReporterto send.resume([...], directory:)and.clear()reports.- Reports are signed with a SHA-256
mackeyed by the terminal'sOSC7577_TOKEN, so ordinary printed output cannot create resume records. - Each argument reaches the program as one argument, without a shell.
ProgramResumeReporter()returnsnilwhen the terminal provides no token, so you can detect support in one line.ResumeToken.removeFromEnvironment()andResumeToken.removing(from:)keep child processes from inheriting the token.ResumeEncoder.encode(_:token:terminator:)builds a full signed sequence. It fails with aProgramResumeErrorif a report goes over 64 arguments or 2048 bytes.
- Reports are signed with a SHA-256
📚 Documentation
- New DocC landing page for
OSC, with one article per protocol. - New "Adding a Protocol" guide that describes the per-protocol layout.
- The README and Swift Package Index configuration use the new name.
🔧 Under the Hood
- Program Status and Program Resume now share one core for framing, terminators, key=value pairs, text validation, and terminal output. The library still has no dependencies and still supports macOS 13 and later.
- Property-based tests (built with Hegel) now check both protocols against models written from their specifications, and they run in CI and nightly.