Skip to content

0.5.0

Latest

Choose a tag to compare

@velocityzen velocityzen released this 27 Nov 00:03
67fba61

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 as OSC. 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 ProgramResumeReporter to send .resume([...], directory:) and .clear() reports.
    • Reports are signed with a SHA-256 mac keyed by the terminal's OSC7577_TOKEN, so ordinary printed output cannot create resume records.
    • Each argument reaches the program as one argument, without a shell.
    • ProgramResumeReporter() returns nil when the terminal provides no token, so you can detect support in one line.
    • ResumeToken.removeFromEnvironment() and ResumeToken.removing(from:) keep child processes from inheriting the token.
    • ResumeEncoder.encode(_:token:terminator:) builds a full signed sequence. It fails with a ProgramResumeError if a report goes over 64 arguments or 2048 bytes.

📚 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.