ratresume 🐀
A Rust library for reporting program-resume commands with Program Resume Protocol (OSC 7577).
flowchart LR
App[Your TUI] -->|report command| Terminal[Terminal]
Terminal -->|restart app| App
Q: What is this for?
A: ratresume allows your app to tell a supporting terminal how to restart your app with the same arguments and working directory after a terminal session is restored.
Quick start
Add ratresume to your project:
Call Reporter::from_env
to read OSC7577_TOKEN.
Supporting terminals set this variable; if it is
missing, no report will be sent.
let mut reporter = from_env?;
Describe how your app restores its saved state:
let session_path = new;
let argv = vec!;
let cwd = current_dir?;
Call Reporter::report to send the resume command to the terminal:
if let Some = reporter.as_mut
A supporting terminal can use this command to restart your app with the same arguments and working directory when restoring the session.
Usage
Here is a simple function that reports how to resume the current application with --resume <session_path>:
Examples
-
ratatui.rsis a small counter app that saves its value and reports how to resume itself.Run it with:
Use the arrow keys to change the counter and
qto quit.
Contributing
See CONTRIBUTING.md for development checks and contribution guidelines.
Please report security issues through GitHub Security Advisories, not public issues. See SECURITY.md for details.
License
Licensed under The MIT License.
🦀 ノ( º _ º ノ) - respect crables!
Copyright
Copyright © 2026, Orhun Parmaksız